Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Hidden worksheet problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Hidden worksheet problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Hidden worksheet problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Hidden worksheet problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Hidden worksheet problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Hidden worksheet problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Hidden worksheet problem

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem - hidden cell names in worksheet Bigger Excel Worksheet Functions 2 February 1st 10 03:18 PM
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Problem copying from a hidden worksheet (data is copied, but alsoadditional sheet info) Dave Peterson Excel Programming 3 January 31st 08 06:26 PM
Problem copying from a hidden worksheet (data is copied, but alsoadditional sheet info) Susan Excel Programming 0 January 31st 08 03:35 PM
Problem with Hidden Worksheet Shatin[_2_] Excel Programming 4 September 4th 05 07:01 AM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"