PDA

View Full Version : VBA Code: Use keyboard keys in VBA coding



murthysri272
02-17-2016, 04:10 PM
Hi,
Once my data is ready in excel I have to load data in to database using keyboard options.
I have to load data using Alt+x+x+e.

Please let me know how can i achieve this step in VBA coding.

Regards,
Sri

SamT
02-17-2016, 05:51 PM
Record a macro while you load the data. Study the macro,

murthysri272
02-18-2016, 09:25 AM
Hi,
Can i use code like below?

Sub test()
Dim objShell
Sheets("Sheet1").Select
Range("G6").Select
Range(Selection, Selection.End(xlDown)).Select
objShell.SendKeys "{xxe}"
End Sub

Please correct me if I am wrong.

Regards,
Sri