PDA

View Full Version : Counting the Rows including blank ones



JJanower
10-26-2011, 08:12 AM
hi,
Is there a way to do a full Rowcount including the blank ones?

because if I use this code:

RowCount = Worksheets("Sheet1").Cells(1, 1).CurrentRegion.Rows.Count

it usually stops until it finds the first blank Row.
thx

Kenneth Hobs
10-26-2011, 08:23 AM
Normally, one would get the last row from column A from the bottom up.
RowCount = Worksheets("Sheet1").Range("A" & rows.count).End(xlUp).Row

Of course there could be formatted blank rows below the last row with data.

JJanower
10-28-2011, 06:37 AM
Thank you Mr. Hobs, this helped me alot with the project I am developing.

Is there also a way to do a complete ColumnCount with a similar code?
would it be something like this?

LastColumn= Worksheets("Sheet1").Cells(Columns.Count, "A").End(xlToLeft).Column
tyvm in advance

Kenneth Hobs
10-28-2011, 06:54 AM
LastColumn= Worksheets("Sheet1").Cells(1, Columns.Count).End(xlToLeft).Column

JJanower
10-28-2011, 07:14 AM
Great thanks alot Mr. Hobs