Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
User form
Hi all,
I am trying to adapt the information from http://www.contextures.com/xlUserForm01.html to make a userform for my worksheet. I got everything working, almost!!! The form enters data in A2 of my sheet and I can't figure out how to make it enter it into the next available cell in the range of F17:F50. There were alot of places I had to change things in Debra's code to work for my form and I think I must have done something wrong. Any help would be appreciated. Here is the code that I have so far: Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("DataInput") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'check for a employee name If Trim(Me.txtName.Value) = "" Then Me.txtName.SetFocus MsgBox "Please enter New Employee Name" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.txtName.Value 'clear the data Me.txtName.Value = "" End Sub Thanks Mike Rogers |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
user form question: text box to display result | Excel Discussion (Misc queries) | |||
user form question: text box to display result | Excel Worksheet Functions | |||
Example User Form Required | Excel Discussion (Misc queries) | |||
Print scrollable user form. | Excel Discussion (Misc queries) | |||
Data Entry Alert in User Form | Excel Discussion (Misc queries) |