I have excel sheet with four column in it. First is unique customer ID, second is token number, third is price and fourth is product code.
I want to find row number by finding token number by entering token number in inputbox. For example if 99 token number is in B5 cell then i want to search
row number 5 and assign 5 to variable called "nn". After putting 5 into "nn" variable i can used this variable in my script and can complete my whole script, but i can not figure out how can find row number by searching with inputbox and put found row number into a variable. Here is my whole script with missing part of get row number. Can anybody help me to complete the missing part of script.
Code: Select all
F10::
FilePath = %A_Desktop%\Order List.xls
oWorkbook := ComObjGet(FilePath)
InputBox, tn, Token to find, please enter the Token No. to find Row No.
[Missing part :
Finding entered token number (which are assigned to "tn" variable) and get the row number of Column "B" and assign to "nn" variable
:Missing Part]
n1 := oWorkbook.Worksheets(1).Range("A" nn).text ;get the customer unique ID from a cell with column "A" and row "nn"
n2 := oWorkbook.Worksheets(1).Range("B" nn).text
n3 := oWorkbook.Worksheets(1).Range("C" nn).text
n4 := oWorkbook.Worksheets(1).Range("D" nn).text
ControlSetText, Edit1, % n1, Test Software ; put the cell ("A" nn) value to test software's textbox.
ControlSetText, Edit2, % n2, Test Software
ControlSetText, Edit3, % n3, Test Software
ControlSetText, Edit4, % n4, Test Software
return