Need a little help

Rick Johnson

New Member
Joined
Oct 18, 2008
Messages
17
Office Version
  1. 365
  2. 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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
It should be

Rich (BB code):
NextRow = Worksheets("Data").Cells(Rows.Count, 1).End(xlUp).Row + 1
 
Upvote 0
I'm using Excel 2010...could there be an issue with that version? Or something else I am missing? Thanks again!
 
Upvote 0
Thanks for your help. I got it figured out...it amounted to how I had my sheets named, but it is working fine now.

Rick :)
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top