Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

placing forms textbox inputs into excel database.

Status
Not open for further replies.

bsurfn99

Technical User
Mar 23, 2005
34
US
I am trying to have the inputs from a form, populate a database on a seperate sheet of the same workbook. I need the database to start at a specific cell. I have a heading on the top and the first two columns have formulas. I have been playing around with my code and it seems that the formulas are setting the start point for form inputs. example, column A has formulas down to row 10, then the inputs will start at C11. Note, in the process of working on this issue I screwed something up and it no longer indexes for the next entry.

Here is what I have so far, I was hoping someone could help me over this hurdle.


Private Sub cmdsubmit_Click()

' goto database
Sheets("database").Select

Dim input1 As String
Dim RowNum As Long

input1 = txt_input1.Text
' Put the data in the current worksheet:
If Cells(3, 3).Value = "" Then
RowNum = 1
Else
RowNum = ActiveSheet.UsedRange.Rows.Count + 1
End If
Cells(RowNum, 3).Value = input1

'go home
Sheets("home").Select

Unload form1
End Sub


thanks in advance for the help...
 
Excel VBA questions are better covered in forum707

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top