Copying & Pasting in a Hidden Sheet

eoinymc

Board Regular
Joined
Jan 29, 2009
Messages
203
Hi,

I have the following code (which works fine when the sheet isn't hidden)

Code:
FinalRow2 = TtlRev.Cells(Rows.Count, 1).End(xlUp).Row
TtlRev.Range("AM6:AO6").Copy
TtlRev.Range(Cells(6, 39), Cells(FinalRow2, 41)).Select
ActiveSheet.Paste


However, I need to hide the sheet, but it doesn't work because you can't use .select on a hidden sheet I believe.

Has anyone got a way of doing this to a hidden sheet?

Thanks,

E
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Try

Code:
TtlRev.Range("AM6:AO6").Copy Destination:=TtlRev.Cells(6, 39)
 
Upvote 0
No, that doesn't work, because FinalRow2 is a dynamic variable.

On this particular sheet, it equals 126.

So, I am copying 1 row of data (Row 6) and then want to paste it to Rows 6-126.

Does that make sense?

Thanks,

E
 
Upvote 0
Maybe (the point being that you do not need to select)

Code:
FinalRow2 = ttlrev.Cells(Rows.Count, 1).End(xlUp).Row
ttlrev.Range("AM6:AO6").Copy Destination:=ttlrev.Range(ttlrev.Cells(6, 39), ttlrev.Cells(FinalRow2, 41))
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top