Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Copy a sheet and rename it

Can someone please show me what I am stupidly missing:

I want to make a copy of a very hidden sheet named LogTemplate and position
it after the sheet named LOG (visible). Rename the copy as Log Future # where
# is the next number in sequence. So if Log Future 1 already exists, name the
new one Log Future 2, and so on...

I won't post my code (unless someone requests it) since it is useless any way.

Thanks much in advance for your assistance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Copy a sheet and rename it

try unhiding the sheet.
copy it
rename it
then hide it again
or is that what you are needing help with?

"quartz" wrote:

Can someone please show me what I am stupidly missing:

I want to make a copy of a very hidden sheet named LogTemplate and position
it after the sheet named LOG (visible). Rename the copy as Log Future # where
# is the next number in sequence. So if Log Future 1 already exists, name the
new one Log Future 2, and so on...

I won't post my code (unless someone requests it) since it is useless any way.

Thanks much in advance for your assistance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Copy a sheet and rename it

Really? I didn't think you needed to unhide the sheet to copy it...

"ben" wrote:

try unhiding the sheet.
copy it
rename it
then hide it again
or is that what you are needing help with?

"quartz" wrote:

Can someone please show me what I am stupidly missing:

I want to make a copy of a very hidden sheet named LogTemplate and position
it after the sheet named LOG (visible). Rename the copy as Log Future # where
# is the next number in sequence. So if Log Future 1 already exists, name the
new one Log Future 2, and so on...

I won't post my code (unless someone requests it) since it is useless any way.

Thanks much in advance for your assistance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Copy a sheet and rename it

You are right...it worked as you said. Thanks.

"quartz" wrote:

Really? I didn't think you needed to unhide the sheet to copy it...

"ben" wrote:

try unhiding the sheet.
copy it
rename it
then hide it again
or is that what you are needing help with?

"quartz" wrote:

Can someone please show me what I am stupidly missing:

I want to make a copy of a very hidden sheet named LogTemplate and position
it after the sheet named LOG (visible). Rename the copy as Log Future # where
# is the next number in sequence. So if Log Future 1 already exists, name the
new one Log Future 2, and so on...

I won't post my code (unless someone requests it) since it is useless any way.

Thanks much in advance for your assistance.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Copy a sheet and rename it

Dim i As Long
Dim sh As Worksheet

i = 0
On Error Resume Next
Do
Set sh = Nothing
i = i + 1
Set sh = Worksheets("Log Future " & i)
Loop Until sh Is Nothing
On Error GoTo 0

Worksheets("Sheet2").Copy after:=Worksheets("Log")
ActiveSheet.name = "Log Future " & i


--

HTH

RP
(remove nothere from the email address if mailing direct)


"quartz" wrote in message
...
Can someone please show me what I am stupidly missing:

I want to make a copy of a very hidden sheet named LogTemplate and

position
it after the sheet named LOG (visible). Rename the copy as Log Future #

where
# is the next number in sequence. So if Log Future 1 already exists, name

the
new one Log Future 2, and so on...

I won't post my code (unless someone requests it) since it is useless any

way.

Thanks much in advance for your assistance.



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
keyboard shortcut to pull up sheet menu(copy,delete,rename,etc)? EMD Excel Discussion (Misc queries) 1 April 22nd 09 07:59 PM
Copy worksheet and rename sheet Ernst - EXE Graphics Excel Discussion (Misc queries) 4 July 25th 08 01:18 PM
Macro REQ: Automatically copy a template sheet and rename MCSmarties Excel Worksheet Functions 5 October 11th 07 09:18 PM
Copy/Rename a sheet DK Links and Linking in Excel 1 March 20th 06 05:36 AM
copy Sheet and rename it! John Smith[_9_] Excel Programming 3 September 7th 04 06:23 PM


All times are GMT +1. The time now is 01:12 PM.

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

About Us

"It's about Microsoft Excel"