[wtr-general] Re: How to determine last used row in Excel sheet
If I understood your question correctly, you are getting data from the excel spreadsheet in a for loop and you can print the last row used using the iteration value. On Thu, May 7, 2009 at 3:27 AM, sHiVa krapa.ph...@gmail.com wrote: Hi all, I need to find out the last used row number in my excel work sheet. I am able to find out the number of rows in a used area using this code snipped worksheet = workbookObject.WorkSheets(Results Sheet) worksheet.Select usedArea=worksheet.usedRange puts usedArea.Rows.Count Please any one help me to find out the last used row number. Cheers Siva Phaneendra Krapa --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to determine last used row in Excel sheet
Hi Anu, Thanks for your suggestion. As u said i can navigate to the last row in the used range of excel and print the data. My question is the used range may start from any cell like Range(D5:H10). I would like to determine the H10 (Where 10 is the last used row number) value in the range. any way i got the solution for my query. Here is the statement useful usedAreaaddress=worksheet.UsedRange.ActiveRange.adress That will return the address of Used range in an excel sheet Regards Siva Phaneendra krapa --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---