Yoshimu wrote:Hey,
at this moment I use:
Code: Select all
XL.Range("G200").Select
XL.ActiveCell.Offset(0,0).Value := Var1
But this cell "A200" every day changes.
So I Would like to use FInd function, that will look for defined text eg "Client name" in Column G (or other). Than if VBA found, select this cell.
Is it possible to implement something like this in AHK?
Thanks for any help
Not entirely sure exactly what you want so here is general knowledge about Find.
Here is example code of Finding a value in a column.
Code: Select all
Xl := ComObjActive("Excel.Application")
InputBox, Needle, Search, % "Workbook:`t" Xl.ActiveWorkbook.Name "`nSheet: `t`t" Xl.ActiveSheet.Name "`n`n" "Enter Search String for Column G"
Found := Xl.Columns("G").Find(Needle)
if !Found
{
MsgBox NOT FOUND
ExitApp
}
MsgBox % Found.Address "`t=`t" Found.Value
This allows you to enter what to look for in column G.
If you want to Find the value in cell A200 in the column G, you can do:
Code: Select all
Needle := Xl.Range("A200").Value
Found := Xl.Columns("G").Find(Needle)
The Find command allows a bunch of options.
https://msdn.microsoft.com/en-us/librar ... 39746.aspx
Find is also much quicker and more efficient than looping through all the cells in a range.
FG