Rick Johnson
New Member
- Joined
- Oct 18, 2008
- Messages
- 17
- Office Version
- 365
- 2016
I have Bill's Live Lessons "Excel VBA and Macros with MrExcel." I have been working on creating a userform, but I have been having trouble with a line of code. I went back to trying a very simple userform, but still have the same error.
Can someone help me out by pointing me in the right direction? Thanks a lot folks.
Best regards,
Rick Johnson
Code:
Private Sub CommandButton1_Click()
'Find the next row on the data sheet
NextRow = Worksheets("Data"). _
.Cells(Row.Count, 1).End(x1up).Row 1
'Write the values from this form to that row
With Worksheets("Data")
.Cells(NextRow, 1).Value = Me.TBname
.Cells(NextRow, 1).Value = Me.TBaddress
.Cells(NextRow, 1).Value = Me.TBcity
.Cells(NextRow, 1).Value = Me.TBstate
.Cells(NextRow, 1).Value = Me.TBzip
End With
'Unload the form
Unload Me
End Sub
Private Sub Commandbutton_2Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Can someone help me out by pointing me in the right direction? Thanks a lot folks.
Best regards,
Rick Johnson
Code:
Private Sub CommandButton1_Click()
'Find the next row on the data sheet
NextRow = Worksheets("Data"). _
.Cells(Row.Count, 1).End(x1up).Row 1
'Write the values from this form to that row
With Worksheets("Data")
.Cells(NextRow, 1).Value = Me.TBname
.Cells(NextRow, 1).Value = Me.TBaddress
.Cells(NextRow, 1).Value = Me.TBcity
.Cells(NextRow, 1).Value = Me.TBstate
.Cells(NextRow, 1).Value = Me.TBzip
End With
'Unload the form
Unload Me
End Sub
Private Sub Commandbutton_2Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub