View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Geeta Sonawane Geeta Sonawane is offline
external usenet poster
 
Posts: 4
Default Determining the last row

I am using another way to determining the Last row in excel worksheet as:

lastrow=Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

actually I used same think which you are using for determining the last row but I want to take a last row after row 10 which may be not used in some workbook so I am adding some value in 10th row of one cell and then using the last row. It is working fine.



Gary Keramidas wrote:

excel 2010 question regarding determining the last row
11-Mar-10

never really used 2007, so i'm wondering if you have seen this behavior in
2010, or 2007, for that matter.

typically, in 2003, ws3.Cells(Rows.Count, "A").End(xlUp).Row, would return
the last row

but, in 2010, i frequently get debugs on this line when opening a 2003
workbook in compatibility mode.

so, i've resorted to change the code to this and it seems to resolve the
issue:
ws3.Cells(ws3.Rows.Count, "A").End(xlUp).Row

seems excel is sometimes thinking it has a million rows, when in fact there
are only 65000, so it debugs. seems to happen when i open another workbook
with code.

anyone seen this or have a better way?


--


Gary Keramidas
Excel 2003

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
What's New for Developers in SharePoint 2010 Object Model?
http://www.eggheadcafe.com/tutorials...evelopers.aspx