.. Is how I feel trying to write this code.
My intent is for the macro to check cell E3 for an account number(16 digits)... If there is not account number in the cell then check for a secondary acct ID in cell D3(fewer digits)......So you can universally paste an account number in E3 or acct id in D3 and it will pull data with either value.
The account number is stand alone and can be used to pull the data.
The account ID needs the label "3560ai" placed in front of it to be read in the external application.
It seems like it just takes a complex if then statements to run... but I can't figure out where to place the 3560ai in the code to be read without the first Set rng = Range("E3") picking it up and trying to use the tag.
So on my side, after the ID from either E3 or D3 is read based on whether the value is present.
I want to select that specific ID and turn that selected ID into a rng.txt...this rng.txt object will be used to pull data from the external application then placed into specific designated columns. this is an example
So the macro goes into an program and basically copies and pastes several pieces of data in specific cells.
This is part of the actual code.
Imagine a spreadsheet:
(D2);(E2) ;(F2) ; (G2)
Acct ID; Acct Num; Related Accts;Create Date
'PullAcctID
mSession.Screen.SendKeys ("<Pf3><Clear>")
mSession.Screen.WaitHostQuiet (waitTime)
mSession.Screen.SendKeys ("<Home>iagi" & rng.Text & "<Enter>") so this line is typing on the application "iagi" and using the acct number from E2 (rng.txt.) this was set at the beginning of the original script then places the trimmed data from the application in cell D2 with the rng.offset line below
mSession.Screen.WaitHostQuiet (waitTime)
mSession.Screen.SendKeys ("<Home>" & "<Enter>")
mSession.Screen.WaitHostQuiet (waitTime)
rng.Offset(0, -1).Value = (Trim(mSession.Screen.GetString(14, 14, 11)))