Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi gurus
I have a 'novice' question. It refers to a table that can a variable number of rows and columns. The cells of the table have lined borders. The upper left cell of the table is "A3". I need code that produces the row number of the LAST row in the table. (This row may have values in its cells or its cells may be empty.) thanks a lot |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
Msgbox Cells(Rows.Count, "A").End(xlUp).Row -- Jacob "Victoria" wrote: hi gurus I have a 'novice' question. It refers to a table that can a variable number of rows and columns. The cells of the table have lined borders. The upper left cell of the table is "A3". I need code that produces the row number of the LAST row in the table. (This row may have values in its cells or its cells may be empty.) thanks a lot |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi Jacob - your code snippet works well when there is an entry in the cell.
But the cells may be empty. Every cell in the table has a line border on all 4 sides (When printed, many cells will be empty, but workers fill in values for later data entry.) What I need is to be able to identify the row number of the last formatted row. Thanks Victoria "Jacob Skaria" wrote: Try Msgbox Cells(Rows.Count, "A").End(xlUp).Row -- Jacob "Victoria" wrote: hi gurus I have a 'novice' question. It refers to a table that can a variable number of rows and columns. The cells of the table have lined borders. The upper left cell of the table is "A3". I need code that produces the row number of the LAST row in the table. (This row may have values in its cells or its cells may be empty.) thanks a lot |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
--Which version of XL do you use...
--Are you referring to 2007 table -- Jacob "Victoria" wrote: hi Jacob - your code snippet works well when there is an entry in the cell. But the cells may be empty. Every cell in the table has a line border on all 4 sides (When printed, many cells will be empty, but workers fill in values for later data entry.) What I need is to be able to identify the row number of the last formatted row. Thanks Victoria "Jacob Skaria" wrote: Try Msgbox Cells(Rows.Count, "A").End(xlUp).Row -- Jacob "Victoria" wrote: hi gurus I have a 'novice' question. It refers to a table that can a variable number of rows and columns. The cells of the table have lined borders. The upper left cell of the table is "A3". I need code that produces the row number of the LAST row in the table. (This row may have values in its cells or its cells may be empty.) thanks a lot |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi again
I'm using Excel 2002. I'm not sure what you mean by a '2007 table', but I'm simply refering to an area of the Sheet that has bordered cells. If printed, it would look like a sheet of graph paper. I need to be able to identify the last row, even if its cells contain no values. Sorry if I'm using terms improperly Victoria "Jacob Skaria" wrote: --Which version of XL do you use... --Are you referring to 2007 table -- Jacob "Victoria" wrote: hi Jacob - your code snippet works well when there is an entry in the cell. But the cells may be empty. Every cell in the table has a line border on all 4 sides (When printed, many cells will be empty, but workers fill in values for later data entry.) What I need is to be able to identify the row number of the last formatted row. Thanks Victoria "Jacob Skaria" wrote: Try Msgbox Cells(Rows.Count, "A").End(xlUp).Row -- Jacob "Victoria" wrote: hi gurus I have a 'novice' question. It refers to a table that can a variable number of rows and columns. The cells of the table have lined borders. The upper left cell of the table is "A3". I need code that produces the row number of the LAST row in the table. (This row may have values in its cells or its cells may be empty.) thanks a lot |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Victoria
Microsoft has introduced a new concept of working with tables of data in Excel 2007. This new functionality is called "tables" which is the successor of Excel 2003's "List" feature........ If you are having a list you can try Activesheet.ListObjects(1).listrows.count If not a list but only formatted with borders... Then try the below macro Sub Macro() Dim lngRow As Long lngRow = 3 Do: lngRow = lngRow + 1 Loop Until Range("A" & lngRow).Borders.LineStyle = xlLineStyleNone lngRow = lngRow - 1 End Sub -- Jacob "Victoria" wrote: hi again I'm using Excel 2002. I'm not sure what you mean by a '2007 table', but I'm simply refering to an area of the Sheet that has bordered cells. If printed, it would look like a sheet of graph paper. I need to be able to identify the last row, even if its cells contain no values. Sorry if I'm using terms improperly Victoria "Jacob Skaria" wrote: --Which version of XL do you use... --Are you referring to 2007 table -- Jacob "Victoria" wrote: hi Jacob - your code snippet works well when there is an entry in the cell. But the cells may be empty. Every cell in the table has a line border on all 4 sides (When printed, many cells will be empty, but workers fill in values for later data entry.) What I need is to be able to identify the row number of the last formatted row. Thanks Victoria "Jacob Skaria" wrote: Try Msgbox Cells(Rows.Count, "A").End(xlUp).Row -- Jacob "Victoria" wrote: hi gurus I have a 'novice' question. It refers to a table that can a variable number of rows and columns. The cells of the table have lined borders. The upper left cell of the table is "A3". I need code that produces the row number of the LAST row in the table. (This row may have values in its cells or its cells may be empty.) thanks a lot |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding 1st,2nd,3rd etc | Excel Discussion (Misc queries) | |||
finding a tab name | Excel Programming | |||
Finding last used | Excel Worksheet Functions | |||
finding the "end" | New Users to Excel | |||
Finding Last Row | Excel Programming |