LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Reference to Sheet Name When Copying Worksheet

In a macro I am copying a master worksheet to a new workbook. In some of the
cells of the master I have nested if statements with Vlookups. Sample:

=IF(C9="","",IF(AND(TEXT(C9+90,"ddd")="Sat",ISERRO R(VLOOKUP(C9+92,
Holidays!$A$1:$B$1000,2,FALSE))),C9+92,IF(TEXT(C9+ 90,"ddd")="Sat",
C9+93,IF(AND(TEXT(C9+90,"ddd")="Sun",ISERROR(VLOOK UP(C9+91,
Holidays!$A$1:$B$1000,2,FALSE))),C9+91,IF(TEXT(C9+ 90,"ddd")="Sun",
C9+92,IF(ISERROR(VLOOKUP(C9+90,Holidays!$A1:$B$100 0,2,FALSE)),
C9+90,C9+91))))))

When I copy the sheet using VB (ThisWorkbook.Sheets(2).Copy
Befo=ActiveWorkbook.Sheets(1)), the sheet name reference (Holidays)
expands to include the master workbook name and path. I want the newly
created worksheet to keep the reference "Holidays1" just the way it is.
Have I explained this well enough for someone to assist please?

--
Ken Hudson
 
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
changing worksheet reference name when copying down cells ferne Excel Worksheet Functions 5 May 20th 10 02:55 AM
Range Reference When Copying Sheet fm One WB to Ken Hudson Excel Programming 1 July 1st 08 05:20 PM
Copying a work sheet cell reference as relative not absolute? Velson Excel Discussion (Misc queries) 4 January 7th 06 01:46 PM
copying and paste data from each worksheet to a summary work sheet mary Excel Programming 5 January 21st 05 05:25 PM
Report: Copying pagebreaks of a reference sheet to other sheets masayoshi hayashi Excel Programming 1 December 26th 03 03:10 AM


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