Is it possible to Copy From or Paste To a hidden sheet?

T

Tom Joseph

Is this possible?

If so, I would appreciate a bit of example code.

I greatly appreciate any help.

Best regards,

Tom
 
R

Rick Rothstein

Copy from hidden sheet
=======================
Worksheets("Hidden").Range("A1:E5").Copy Worksheets("Sheet1").Range("A1")

Copy to hidden sheet
=======================
Worksheets("Sheet1").Range("A1:E5").Copy Worksheets("Hidden").Range("A1")

Adjust your sheet names, copy ranges and destination upper left destination
cell as appropriate for your setup.
 
H

Heera

Here is the code.....

Assume you are in sheet2 and run the macro.
hide sheet1 and put some value in Cell A1 of sheet1
It will work fine.

Sub Macro4()
'
ActiveCell.Value = Sheets("Sheet1").Range("A1").Value
Sheets("Sheet1").Range("A2").Value = 500

End Sub
 
R

Rick Rothstein

By the way, you should note that it is not necessary to do a 2-step
operation (copy first then paste).... you can simply copy to your
destination directly.
 
T

Tom Joseph

Hi Rick,

This worked fine.
Worksheets("Hidden").Range("A1:E5").Copy Worksheets("Sheet1").Range("A1")

Instead of "A1:E5" I want to copy the entire sheet and also paste it as
values.

Can you help with this?

Thanks.
 
R

Rick Rothstein

Try this statement...

Worksheets("Hidden").Cells.Copy Worksheets("Sheet1").Range("A1")

Remember to change the destination worksheet name if necessary.
 
T

Tom Joseph

Thanks, Rick.

Rick Rothstein said:
Try this statement...

Worksheets("Hidden").Cells.Copy Worksheets("Sheet1").Range("A1")

Remember to change the destination worksheet name if necessary.
 
Top