ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   subscript out of range error: tyring to copy a hidden sheet (https://www.excelbanter.com/excel-programming/432167-subscript-out-range-error-tyring-copy-hidden-sheet.html)

Sam

subscript out of range error: tyring to copy a hidden sheet
 
I got a subscript out of range error when trying to copy sheet2. Sheet2 is
hidden.

here is the code:

Worksheets("Hidden").Copy Worksheets("Sheet2")

Thanks in advance

Atishoo

subscript out of range error: tyring to copy a hidden sheet
 
You shouldnt need the "hidden"


"sam" wrote:
Worksheets.Copy Worksheets("Sheet2") should work fine
I got a subscript out of range error when trying to copy sheet2. Sheet2 is
hidden.

here is the code:

Worksheets("Hidden").Copy Worksheets("Sheet2")

Thanks in advance


Atishoo

subscript out of range error: tyring to copy a hidden sheet
 
If you want the copy to be hidden also set it to visible = false.
If you want it to folow after a certain worksheet set it to copy after:= etc
and perhaps give the copy a name of your choice.

Worksheets("Sheet2").Copy After:=Worksheets("Sheet1")
ActiveSheet.Name = ("name of your choice")
ActiveSheet.Visible = False

good luck john

Atishoo

subscript out of range error: tyring to copy a hidden sheet
 

I dont know about copying your worksheet! you certainly seem to have coppied
your question successfully a few times.
I hope some of the answers prove useful
good luck


All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com