Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
xlLastCell question
I am using Excel 97.
I tried this command in a macro. ActiveCell.SpecialCells(xlLastCell).Select I thought that the above command will return the last cell that contains data. When I issued this command, it returned a cell that was blank. I am after the last row in the spreadsheet that contains data. Is there a better way than the above command ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
xlLastCell question
Rich wrote:
I tried this command in a macro. ActiveCell.SpecialCells(xlLastCell).Select I thought that the above command will return the last cell that contains data. When I issued this command, it returned a cell that was blank. Try ActiveSheet.UsedRange.SpecialCells(xlLastCell).Sel ect LastCell gives the cell in the last Row that has been used and the last Column that has been used since the worksheet was created - or since the UsedRange method was used on the sheet. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. | Excel Worksheet Functions | |||
Cntrl + End (xlLastCell) | Excel Discussion (Misc queries) | |||
.SpecialCells(xlLastCell).Select | Excel Programming | |||
XP VBA: Range("A2", ActiveCell.SpecialCells(xlLastCell)).Select | Excel Programming |