determine empty row

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
hi i am reading a code and part of it is to determine an empty row, please see below.
I could not understand it!! I tried to enter A1=10, A2=20, A3=30
I got 4. So row 4 is empty. So far so good. But when I did A1=10, A2=(empty), A3=30
I got 3 but row 3 is not empty. Is the code below makes any sense to you? Thank you


'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1


https://www.excel-easy.com/vba/userform.html
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
If you have values in A1 & A3 countA will give 2 (ie 2 values in the column) you then add 1 which gives 3.

If you are looking for the last used row +1 try
Code:
range("A"&rows.Count).End(xlUp).Offset(1).row
 
Upvote 0

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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