Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Through the valuable contributions of the MVPs and other members of this
group, I've learned a lot over the years- so thank you to everyone for your ongoing participation and assistance. One thing I picked up here was the following code to find the last used row: LastRow = Sheet1.Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row This has worked for me for quite some time, but now I've run into a situation where it returns a higher row number than desired- in this case, the users of the workbook can manually delete (with the delete key, which actually just clears) rows, and the code above (again, some of the time) is returning a much later row than the last row that actually has any text in it. Conclusion- Excel requires some event or action to really think those rows are "clear". Other than recursively checking each cell in each row, is there something I can do to either (a) return the last blank row, or (b) force excel to clear any blank rows, so I get the desired row number? Thanks, Keith |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is information on this page Keith
http://www.rondebruin.nl/last.htm Note: if there is a space in a cell Excel will see this -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Keith R" wrote in message ... Through the valuable contributions of the MVPs and other members of this group, I've learned a lot over the years- so thank you to everyone for your ongoing participation and assistance. One thing I picked up here was the following code to find the last used row: LastRow = Sheet1.Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row This has worked for me for quite some time, but now I've run into a situation where it returns a higher row number than desired- in this case, the users of the workbook can manually delete (with the delete key, which actually just clears) rows, and the code above (again, some of the time) is returning a much later row than the last row that actually has any text in it. Conclusion- Excel requires some event or action to really think those rows are "clear". Other than recursively checking each cell in each row, is there something I can do to either (a) return the last blank row, or (b) force excel to clear any blank rows, so I get the desired row number? Thanks, Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |