PDA

View Full Version : Paste / Special / Transpose Code



ben_hogan
03-16-2010, 11:22 AM
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

GTO
03-16-2010, 11:49 AM
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?

mdmackillop
03-16-2010, 01:03 PM
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