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


I want to make a copy of the 1st sheet and then rename it.
the name of the sheet is always changing, anyway I can get
VB to select the sheet no matter what it's name is?

Sheets("sheet-x").Copy After:=Sheets(1)
Sheets("sheet-x (2)").Select
Sheets("sheet-x (2)").name = "sheet-y"


--
zerosleep
------------------------------------------------------------------------
zerosleep's Profile: http://www.excelforum.com/member.php...o&userid=17846
View this thread: http://www.excelforum.com/showthread...hreadid=518695

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default recognize a sheet

Either use its index

Sheets(1).Copy After:=Sheets(1)

or its codename

Sheet1.Copy After:=Sheets(1)



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"zerosleep" wrote
in message ...

I want to make a copy of the 1st sheet and then rename it.
the name of the sheet is always changing, anyway I can get
VB to select the sheet no matter what it's name is?

Sheets("sheet-x").Copy After:=Sheets(1)
Sheets("sheet-x (2)").Select
Sheets("sheet-x (2)").name = "sheet-y"


--
zerosleep
------------------------------------------------------------------------
zerosleep's Profile:

http://www.excelforum.com/member.php...o&userid=17846
View this thread: http://www.excelforum.com/showthread...hreadid=518695



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default recognize a sheet


beautiful!!!

thank you bob, I guess it was so simple I didn't even think of it.
all this time I would just change the sheet name to reflect the
macros...much easier now.

-zerosleep


--
zerosleep
------------------------------------------------------------------------
zerosleep's Profile: http://www.excelforum.com/member.php...o&userid=17846
View this thread: http://www.excelforum.com/showthread...hreadid=518695

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
trying to get sheet 1 to recognize and move student names to pg 2 vaughn01 Excel Worksheet Functions 1 December 14th 09 08:30 PM
How do I link cells, sheet to sheet, to recognize row deletions? LeeC Excel Discussion (Misc queries) 30 November 6th 09 10:26 PM
How recognize sheet protected? John Excel Worksheet Functions 1 March 3rd 06 08:43 PM
How do I link cells, sheet to sheet, to recognize row deletion Max Excel Programming 5 February 27th 06 10:27 PM
Getting VBE to recognize a new sheet quartz Excel Programming 5 January 23rd 04 10:39 PM


All times are GMT +1. The time now is 06:40 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"