Okay all - this is driving me insane . I am trying to come up with a VBA macro that will allow me to press a button and the following things will happen:
I have compiled most of the code, however, I can't seem to get the information to either Copy or Paste. I am unsure of what the culprit is of the two... Everything else seems to work except that it just doesn't copy..
Here is the VBA macro I have compiled to this point. Any suggestions?
- Select a range in a (already completed) template.
- Copy the selected range.
- Switch application windows
- Go into 'notes' section of application.
- Paste Selection
- Get out of notes section
- Switch back to Excel
- Clear template data
- Change active cell back to default location
I have compiled most of the code, however, I can't seem to get the information to either Copy or Paste. I am unsure of what the culprit is of the two... Everything else seems to work except that it just doesn't copy..
Here is the VBA macro I have compiled to this point. Any suggestions?
Code:
Sub Macro3()'
' Macro3 Macro
'
'
Range("A1:B71").Select
SendKeys "^C" 'Copies Selected Text
AppActivate "AccuTerm 2K2"
SendKeys "2^M", True 'Enters to notes screen
SendKeys "^M", True 'Confirms above (Enter key)
SendKeys "^V", True 'Pastes into client application
Application.Wait (Now + TimeValue("0:00:05"))
'Providing time for client application to finish
'pasting...
SendKeys "^M", True 'Next three enters are to
SendKeys "^M", True '...exit notes section
SendKeys "^M", True
AppActivate "Microsoft Excel"
Range("B52:B62").Clear 'Clears the Template
Range("B52").Select 'Resets Cell Position
Dim numLock As New NumLockClass
If numLock.value = False Then numLock.value = True
'turns NumLock back on
'Class Module
End Sub
Last edited: