Fordraiders
asked on
Need a check on Columns and cells for empty/null cells past a column header
Need a check on cells for empty/null cells past a column header
vba excel 2010
I have this code trying to count my rows: The data will either be in Column 1(a) Or Column 2(b)
While Len(.Cells(lastRow, 1)) > 0 Or Len(.Cells(lastRow, 2)) > 0
lastRow = lastRow + 1
Wend
The column Header are always in rows 3
Sometimes in Column1 the cells will be empty and i need to calculate the rows in Column2
Both Column cells will never be both filled in:
Will always look like this:
Column1 Column2
account track <---- row 3
11111
22321
445436
Or
Column1 Column2
account track <---- row 3
32de4
656768yu
65tgty
The code above seems ok(working), just wanting to make sure
Thanks
fordraiders
vba excel 2010
I have this code trying to count my rows: The data will either be in Column 1(a) Or Column 2(b)
While Len(.Cells(lastRow, 1)) > 0 Or Len(.Cells(lastRow, 2)) > 0
lastRow = lastRow + 1
Wend
The column Header are always in rows 3
Sometimes in Column1 the cells will be empty and i need to calculate the rows in Column2
Both Column cells will never be both filled in:
Will always look like this:
Column1 Column2
account track <---- row 3
11111
22321
445436
Or
Column1 Column2
account track <---- row 3
32de4
656768yu
65tgty
The code above seems ok(working), just wanting to make sure
Thanks
fordraiders
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
THANKS
=COUNTBLANK(Range)
COUNTBLANK function
The above would be dynamic if you used a Table with a Total Row