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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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