userform to worksheet

rs2k

Well-known Member
Joined
Aug 15, 2004
Messages
1,413
I have created a userform which sends the data to a worksheet (works OK)
What I want is to add more data to the WS on the next available row. At the moment it just keeps overwriting the previous input in row2 (row1 has headings). I believe it works via xlup. or something like that.
Can anyone help?

Colin.
 
As I said earlier this morning, you need to add the Offset command.

Try using

LastRow=Range("B6000").End(xlUp).offset(1,0).Row
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I seem to be going from bad to worse. I have now lost the drop list and got a compile error.

Private Sub DebitDrop1_Change()
LastRow = Range("B6000").End(xlUp).Offset(1, 0).Row
ActiveWorkbook.Names.Add Name:="Creditors", RefersTo:="=Sheet2!$B$2:$B$" & LastRow
End Sub
Is the code laid out correctly?

Colin.
 
Upvote 0
Kristy, The compile error has now gone, although the list keeps disappearing. I think I will scratch this form and start from fresh.
Where should the form/code be located? does it go on the sheet or the workbook?

Any help would be appreciated.
Colin.
 
Upvote 0
Any code to run something on a userform needs to go in the Userform module (right-click the userform and select 'view code')
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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