Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to create a worksheet and call it Master and have the worksheet
hidden. What I need is a routine which will create a copy of the hidden worksheet. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Try this: Sub CopyHiddenSheet() 'Sheets("Master").Visible = False Sheets("Master").Copy After:=Sheets(Sheets.Count) With Sheets(Sheets.Count) .Name = "Master" & Sheets.Count .Visible = True End With End Sub Regards, Per On 20 Okt., 04:41, "Patrick C. Simonds" wrote: I would like to create a worksheet and call it Master and have the worksheet hidden. What I need is a routine which will create a copy of the hidden worksheet. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.
This does just about almost what I need it to. One problem though is that it renames the hidden worksheet. It changes it from Master to Master (2) which means of course, the next time the code is run it fails because it is looking for Master. So is there any way to prevent this and to give the newly created worksheet the name "Blank"? "Per Jessen" wrote in message ... Hi Try this: Sub CopyHiddenSheet() 'Sheets("Master").Visible = False Sheets("Master").Copy After:=Sheets(Sheets.Count) With Sheets(Sheets.Count) .Name = "Master" & Sheets.Count .Visible = True End With End Sub Regards, Per On 20 Okt., 04:41, "Patrick C. Simonds" wrote: I would like to create a worksheet and call it Master and have the worksheet hidden. What I need is a routine which will create a copy of the hidden worksheet. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code shouldn't fail. Only the new sheet gets renamed. The original
"Master" sheet is still hidden and doesn't get renamed. "Patrick C. Simonds" wrote: Thanks. This does just about almost what I need it to. One problem though is that it renames the hidden worksheet. It changes it from Master to Master (2) which means of course, the next time the code is run it fails because it is looking for Master. So is there any way to prevent this and to give the newly created worksheet the name "Blank"? "Per Jessen" wrote in message ... Hi Try this: Sub CopyHiddenSheet() 'Sheets("Master").Visible = False Sheets("Master").Copy After:=Sheets(Sheets.Count) With Sheets(Sheets.Count) .Name = "Master" & Sheets.Count .Visible = True End With End Sub Regards, Per On 20 Okt., 04:41, "Patrick C. Simonds" wrote: I would like to create a worksheet and call it Master and have the worksheet hidden. What I need is a routine which will create a copy of the hidden worksheet. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am afraid on my system the hidden worksheet "Master" does in fact get
renamed. It gets renamed to "Master (2)" "Joel" wrote: The code shouldn't fail. Only the new sheet gets renamed. The original "Master" sheet is still hidden and doesn't get renamed. "Patrick C. Simonds" wrote: Thanks. This does just about almost what I need it to. One problem though is that it renames the hidden worksheet. It changes it from Master to Master (2) which means of course, the next time the code is run it fails because it is looking for Master. So is there any way to prevent this and to give the newly created worksheet the name "Blank"? "Per Jessen" wrote in message ... Hi Try this: Sub CopyHiddenSheet() 'Sheets("Master").Visible = False Sheets("Master").Copy After:=Sheets(Sheets.Count) With Sheets(Sheets.Count) .Name = "Master" & Sheets.Count .Visible = True End With End Sub Regards, Per On 20 Okt., 04:41, "Patrick C. Simonds" wrote: I would like to create a worksheet and call it Master and have the worksheet hidden. What I need is a routine which will create a copy of the hidden worksheet. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Each worksheet has two different names (sheet name, codename). The best way
of seeing this is in the VPA Project Explorer. Go to VBA Editor (Alt-F11). The select from menu View - Project Explorer. You will see all the sheets hidden and visible. You will also see both sets of names. The left set of names will match the Tab Names on the Worksheets. The Right (codename) set may or may not match. I believe the Master (2) you are seeing is the codename (right set of names). The codename is read only. "ordnance1" wrote: I am afraid on my system the hidden worksheet "Master" does in fact get renamed. It gets renamed to "Master (2)" "Joel" wrote: The code shouldn't fail. Only the new sheet gets renamed. The original "Master" sheet is still hidden and doesn't get renamed. "Patrick C. Simonds" wrote: Thanks. This does just about almost what I need it to. One problem though is that it renames the hidden worksheet. It changes it from Master to Master (2) which means of course, the next time the code is run it fails because it is looking for Master. So is there any way to prevent this and to give the newly created worksheet the name "Blank"? "Per Jessen" wrote in message ... Hi Try this: Sub CopyHiddenSheet() 'Sheets("Master").Visible = False Sheets("Master").Copy After:=Sheets(Sheets.Count) With Sheets(Sheets.Count) .Name = "Master" & Sheets.Count .Visible = True End With End Sub Regards, Per On 20 Okt., 04:41, "Patrick C. Simonds" wrote: I would like to create a worksheet and call it Master and have the worksheet hidden. What I need is a routine which will create a copy of the hidden worksheet. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The problem is recognizing the new sheet and making it visible. Try this code.
With ThisWorkbook .Worksheets("Master").Copy after:=.Worksheets(.Worksheets.Count) Worksheets(Worksheets.Count).Visible = True End With "Patrick C. Simonds" wrote: I would like to create a worksheet and call it Master and have the worksheet hidden. What I need is a routine which will create a copy of the hidden worksheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem - hidden cell names in worksheet | Excel Worksheet Functions | |||
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da | Excel Discussion (Misc queries) | |||
Problem copying from a hidden worksheet (data is copied, but alsoadditional sheet info) | Excel Programming | |||
Problem copying from a hidden worksheet (data is copied, but alsoadditional sheet info) | Excel Programming | |||
Problem with Hidden Worksheet | Excel Programming |