Re: Check If Active Cell Is In Specified Column
Here is the code (yes I know, the dreaded sendkeys....I'm totally open to alternatives)
Code
Sub AUDIT_FILE()
If ActiveCell.Column <> 1 Or ActiveCell.Row = 1 Then
MsgBox "Please select an account in Column A"
Range("A2").Select
End If
'Application.Wait Now + TimeSerial(0, 0, 3) - this didn't help
' check password page
If IsEmpty(Sheets("Credentiales").Range("A1")) Then ufCredentiales.Show
Open_Audit_File
End Sub
Sub Open_Audit_File()
'at this point it copies the contents of the active cell the user has selected
'and passes it to the host in the very last line
Selection.Copy
Call Shell("C:\uvterm\uvterm.exe", 1)
SendKeys "%F~", Wait:=True
SendKeys "c:\uvterm\uvterm.cfg~", Wait:=True
SendKeys "%CN~", Wait:=True
SendKeys Sheets("Credentiales").Range("A1"), Wait:=True
Application.Wait Now + TimeSerial(0, 0, 1)
SendKeys "~", Wait:=True
Application.Wait Now + TimeSerial(0, 0, 1)
SendKeys Sheets("Credentiales").Range("A2"), Wait:=True
Application.Wait Now + TimeSerial(0, 0, 1)
SendKeys "~", Wait:=True
SendKeys "~", Wait:=True
SendKeys "~", Wait:=True
SendKeys Sheets("Credentiales").Range("A3"), Wait:=True
SendKeys "~", Wait:=True
SendKeys "5~", Wait:=True
SendKeys "1~", Wait:=True
SendKeys "*Q7~", Wait:=True
SendKeys "^v~", Wait:=True
End Sub
Display More