View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Problem with UsedRange.Rows.Count

Add a line to check a cell to see if it is empty (""), If your UsedRange
count is 1. If it is empty, then count is 0.

X= ActiveSheet.UsedRange.Rows.Count
If X = 1 AND Range("A1").Value = "" Then X + 0

MIke F

"alainB " wrote in message
...
Hi,

I use this command to know what will be the next row to use to save the
data of the invoice I just printed. The data of every invoice is save
on one line of the data sheet.

The problem is that if my DATA sheet is empty, no line used, the
command UsedRange.Rows.Count will return 1.

If one line is used, it will also return 1.

To go around this problem, I put a dummy in the first row. But I don't
like it.

Any idea on how to fix my problem ? Is there a way to have
UsedRange.Rows.Count return 0 when no line are used?

Thanks!

Alain


---
Message posted from http://www.ExcelForum.com/