-
Paste / Special / Transpose Code
Do you have any idea why this code would not work? it stops before the paste step. Thank you for your help . . .
Marco.-
Sub post_note_in_journal()
'
' post_note_in_journal Macro
'
'
Range("G8:G23").Select
Selection.Copy
Sheets("NOTE JOURNAL FOR TEST").Select
Range("E3").Select
Application.SendKeys "^{DOWN}", Wait
Application.SendKeys "{DOWN}", Wait
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Application.SendKeys "{HOME}", Wait
End Sub
-
The problem is here: Application.SendKeys "^{DOWN}", Wait
'Wait' is the name of the argument, it needs a True or False (False by default).
I'm afraid I have to turn in for a few hours sleep, but if you would say why you are using sendkeys to Ctrl+Dn Arrow twice, I bet someone will offer a better way.
Have a great day,
Mark
Edit: Criminys, when did my fingers decide to protest?
-
[vba]Sub post_note_in_journal()
Range("G8:G23").Copy
Sheets("NOTE JOURNAL FOR TEST").Range("E3").End(xlDown).Offset(1). _
PasteSpecial Paste:=xlPasteValues, Transpose:=True
End Sub
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules