Userform entering data in the last row instead of the first empty row from top.

ibruzzi

New Member
Joined
Jun 25, 2021
Messages
26
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hi everyone,

Can anybody tell me why my userform is adding values to the last row of the table instead of the first empty row from the top? And it keeps adding below the last added entry, shifting the added data up. This only happened when I converted the range into a table, before that it was fine.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
without seeing your code, my guess is that you're determining the row to use by looking at a particular column with something like
VBA Code:
RowToUse = cells(rows.count,"A").end(xlup).row + 1
which gives the bottom of the table + 1
try
VBA Code:
RowToUse = Columns("A").cells.find(what:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).row + 1
which gives the last row used in the column + 1
 
Upvote 0
without seeing your code, my guess is that you're determining the row to use by looking at a particular column with something like
VBA Code:
RowToUse = cells(rows.count,"A").end(xlup).row + 1
which gives the bottom of the table + 1
try
VBA Code:
RowToUse = Columns("A").cells.find(what:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).row + 1
which gives the last row used in the column + 1
Thank you for the reply. Sorry for the late reply, I managed to find a workaround before this. Thank you ?
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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