Excel Cell not always in same position

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bad husband
Posts: 54
Joined: 21 Oct 2017, 13:38

Excel Cell not always in same position

28 Mar 2018, 19:50

I have data in a excel spreadsheet that is not always the same. It can have more rows and columns depending on that data collected that week.

In column A there is always a row called “Total”. I need to find the info in the last column for that row.

A B C D
Toys. 1 3 7
Flowers 6 8 0
Paint 3 3 1
Cats 2 5 8
Subtotal 9 9 9
Total 10 10 13

I need to find the value 13.

I found a script to find the row and column of “Total”
https://autohotkey.com/board/topic/1133 ... een-files/

How do I get to the last column of that row? Is it a loop statement?

Any help would be appreciated

Thanks
User avatar
Gurkentoepfer
Posts: 49
Joined: 24 Feb 2014, 14:52

Re: Excel Cell not always in same position

29 Mar 2018, 00:09

Code: Select all

FileName := "c:\temp\test.xlsx"
Xl := ComObjCreate("Excel.Application")
Xl.Workbooks.Open(FileName)
Xl.Visible := True	
LastRow := xl.Sheets(1).UsedRange.rows.count
MsgBox % LastRow


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: vanove and 141 guests