Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find value in any Excel sheet via QM
#1
Greetings,

I need to have 3 things done in excel via QM

1) Using variable 'var1' from QM, I need to find & activate a sheet in excel.
2) Using variable 'var2' from QM, I need to find & select a cell with the 'var2' value in the activated sheet only.
3) Once the cell is found, I need to have the offset(0,-1) value stored in a new QM variable 'var3'.

It is the result in 'var3' that I would be using as the initial input for my previous excel query.

Appreciate your help.

Best Regards,
Philip
Best Regards,
Philip
#2
Macro Macro2494
Code:
Copy      Help
str var1 var2 var3
var1="Sheet1"
var2="e"

ExcelSheet x.Init(var1 1)
ARRAY(Excel.Range) a
if x.Find(var2 a 2)
,Excel.Range r=a[0].Offset(0 -1)
,var3=r.Value
,out F"col={r.Column} row={r.Row} value={var3}"
#3
I am adapting your above code to my usage as shown below.
I am having trouble with using varOptions which is a WindowText
Error message gives me a mismatch

Macro Amended Orders AL - VISTA Verification
Code:
Copy      Help
,for i 0 varOptions.n
,,str tempOpt=varOptions.a[i]
,,if x.Find(tempOpt c 2)
,,,r1=c[0].Offset(0 -1)
,,,varOptions.a[i]=r1.Value
,,,out F"col={r1.Column} row={r1.Row} value={varOptions.a[i]}"
,,else
,,,mes "Trim Not Found"
Best Regards,
Philip
#4
str tempOpt=varOptions.a[i].txt


Forum Jump:


Users browsing this thread: 1 Guest(s)