PDA

View Full Version : Macro to paste on a hidden sheet



andyb313
08-09-2013, 03:24 AM
Here is my macro:
Sub ProdPaste()
'
' ProdPaste Macro
'


'
Sheets("Paste Here").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Agency Hours").Select
End Sub

It does not work when the sheet Paste Here is hidden.

I have tried but cannot figure out the code to perform these actions without the .select and selecting the sheet. Can anyone help?

Thanks in Advance

Andy

Paul_Hossler
08-09-2013, 07:00 AM
This seems to work in my test




Call ActiveWorkbook.Worksheets("Agency Hours").Range("B2").Copy(Worksheets("Paste Here").Range("B2"))


Paul

andyb313
08-09-2013, 07:13 AM
This seems to work in my test




Call ActiveWorkbook.Worksheets("Agency Hours").Range("B2").Copy(Worksheets("Paste Here").Range("B2"))


Paul

But there is no copying. The data is already in the clipboard before the macro is started. How do I do just the paste? I keep getting errors

jolivanes
08-09-2013, 11:21 AM
Sub Try()
Selection.Copy Sheets("Paste Here").Range("A2")
End Sub