Get row number of cell text from excel

Get row number of cell text from excel

mid-awe
Collaborator Collaborator
850 Views
2 Replies
Message 1 of 3

Get row number of cell text from excel

mid-awe
Collaborator
Collaborator

Hi all, 

I am using GetExcel.LSP to read an excel file which I have no prior knowledge of the contents. What I need is to find the row number with a cell containing "PROJECT TOTALS" text.

Currently I have to either guess or just enter a crazy large number to ensure that the row I need falls within the maximum range which can take a long time to process. 

Have any of you dealt with this before? Any help or advice is greatly appreciated.

Thank you in advance. Cheers

0 Likes
851 Views
2 Replies
Replies (2)
Message 2 of 3

Sea-Haven
Mentor
Mentor

You can get max row number likewise column, so that would help by limiting how far down. Will have to find. You may be able to somehow use excel to run "find". (vlax-invoke-method Worksheet "Find" "project) ????

 

Inside getexcel there is a Maxrange$ pretty sure it returns the row:column limits.

(setq CurRegion (vlax-get-property (vlax-get-property
        (vlax-get-property *ExcelApp% "ActiveSheet") "Range" "A1") "CurrentRegion")

0 Likes
Message 3 of 3

mid-awe
Collaborator
Collaborator

Thank you. I'll give that a try straight away.

0 Likes