Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could try this - I've always found that it works
' ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++ +++++++++++++++++++++++++++++ ' Function: Goto_Last ' Author : Alan Hutchins (amended from original by Rob Bovey) ' Date : 23rd December 2003 ' Purpose : Find the Last cell in a worksheet and return the address ' ' ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++ +++++++++++++++++++++++++++++ ' Find Last Cell in worksheet Function Goto_Last(strRange, int_col, int_row) On Error Resume Next Application.ScreenUpdating = False Cells(Cells.Find("*", Range("A1"), , , xlByRows, xlPrevious).Row, _ Cells.Find("*", Range("A1"), , , xlByColumns, xlPrevious).column).Select If Err.Number < 0 Then MsgBox "No data in sheet" Application.ScreenUpdating = True strRange = ActiveCell.AddressLocal int_col = ActiveCell.column int_row = ActiveCell.Row End Function -----Original Message----- Hi Catalin, I don't suppose there are any hidden rows in the spread sheet? Cheers, Foss ----- cata_and wrote: ----- Hello Everybody ! Please help me with UsedRange property. I have a spreadsheet for which I need to know the last used row but I get a wrong result every time I run the macro. I use this line: Worksheets(i).UsedRange.Rows.Count which returns 434 but in reality are 343. I tried also with Worksheets(1).Cells.SpecialCells (xlCellTypeLastCell).Row and the problem persists. Any help ? Thank you Catalin --- Message posted from http://www.ExcelForum.com/ . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 BUG UsedRange/LastCell differences with Excel2003. | Excel Discussion (Misc queries) | |||
Problem with UsedRange.Rows.Count | Excel Programming | |||
UsedRange problem | Excel Programming | |||
Help - How do I reset usedrange in excel 2000 | Excel Programming | |||
UsedRange problem | Excel Programming |