Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locating end of used range- not returning expected value
I have code used to append new records (rows) on sheet 4. In the past, I use the lastrow procedure (below, from this newsgroup) to find the last row where I can add new data. however, in this particular case, it keeps trying to add my data near the top of the worksheet. So I used the rows.count to start troubleshooting, and got the correct value there even though the lastrow procedure is still at the top of the sheet. I have saved, closed, and re-opened the workbook, to no avail. Any ideas why these two would return different values? Thanks, Keith XP/XL2003 (misc code deleted) My_LastRow = Sheet4.Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row MsgBox Sheet4.UsedRange.Rows.Count 'returns a value of 77, which is accurate MsgBox My_LastRow 'returns a value of 2, then after adding a record it returns a value of 3. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sumproduct not returning expected results | Excel Worksheet Functions | |||
Lookup returning one more than expected | Excel Worksheet Functions | |||
Using sum(1/countif....) not returning expected result | Excel Worksheet Functions | |||
Nested "if" not returning expected value | Excel Worksheet Functions | |||
Returning expected dates | Excel Worksheet Functions |