View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tomas M.[_2_] Tomas M.[_2_] is offline
external usenet poster
 
Posts: 3
Default UsedRange and CurrentRegion

Hi,
I need to know realy last row and column, which contains data. I tried to
use UsedRange properties of object worksheet, but this is not what I want in
all real cases:

Sheets("Sheet1").usedrange.rows.count

UsedRange.rows.count properties count also rows only with some formatting
and with no data. Then I tried to use:

Sheets("Sheet1").usedrange.CurrentRegion.rows.coun t

and seems to work OK. Do the last code example find realy last row or column
or count of them in all cases, or is there some better way to get this always
?

Thanks for answer.
Tomas M.