Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This finds the last row in the column with anything in it
r=cells(rows.Count,"a").End(xlUp).Row But, if that cell has a formula in it that returns "", then the statement returns that row because there is a formula in it. I know I could follow the statement with something clumsy like While cells(r,"a")="" r=r-1 But I wonder if there isn't a simpler way. Thanks, James |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
will only work if the blank cells are all at the bottom of the range...
r = Cells(Rows.Count, "a").End(xlUp).Row lBlanks = WorksheetFunction.CountBlank(Range("A1:A" & r)) r = r - lBlanks -- Hope that helps. Vergel Adriano "Zone" wrote: This finds the last row in the column with anything in it r=cells(rows.Count,"a").End(xlUp).Row But, if that cell has a formula in it that returns "", then the statement returns that row because there is a formula in it. I know I could follow the statement with something clumsy like While cells(r,"a")="" r=r-1 But I wonder if there isn't a simpler way. Thanks, James |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Vergel.
"Vergel Adriano" wrote in message ... will only work if the blank cells are all at the bottom of the range... r = Cells(Rows.Count, "a").End(xlUp).Row lBlanks = WorksheetFunction.CountBlank(Range("A1:A" & r)) r = r - lBlanks -- Hope that helps. Vergel Adriano "Zone" wrote: This finds the last row in the column with anything in it r=cells(rows.Count,"a").End(xlUp).Row But, if that cell has a formula in it that returns "", then the statement returns that row because there is a formula in it. I know I could follow the statement with something clumsy like While cells(r,"a")="" r=r-1 But I wonder if there isn't a simpler way. Thanks, James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I put my text at the top of the cell instead of the bottom? | Setting up and Configuration of Excel | |||
dislike jump bottom of column by double-clicking the bottom of cel | Excel Discussion (Misc queries) | |||
how to get a cell on a page to equal the bottom most cell on dif | Excel Worksheet Functions | |||
only last cell on page to have bottom border (cell area outline) | Excel Worksheet Functions | |||
bottom right cell on screen | Excel Programming |