1 row to the other

zaahir

Board Regular
Joined
Oct 11, 2006
Messages
55
Hi
i add data to a spreadsheet using a userform. after having inserted the data i need the next row to be selected and then the new data added into that row.
Please advise me on how to do this!!!

Regards
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
59,397
Office Version
  1. 365
Platform
  1. Windows
You first need to determine which column you are going to use to determine where the next row should go (you should pick a column that will always have data).

If it was column A, here is code that will select the first available row in column A (after the last row of data in column A with data):

Range("A65536").End(xlUp).Offset(1,0).Select
 

zaahir

Board Regular
Joined
Oct 11, 2006
Messages
55
Hi
oh, i have done that bt did nt specify the A & the number. Thanx,
will this code allow for multiple column entries i.e
row 5 data into col d, e, f etc?

Regards
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
59,397
Office Version
  1. 365
Platform
  1. Windows
Once you have selected column A using that code, you can then post things in the other columns in the same row using the offset command, i.e.
if you are in column A and want to post something in column D of that row, you can use:
ActiveCell.Offset(0,3)
or
Cells(ActiveCell.Row, "D")
 

Forum statistics

Threads
1,143,676
Messages
5,720,242
Members
422,272
Latest member
ginkgoVil

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
Top