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: 3
Default Copying Sheet with Formulas

Hi all

I am trying to write a macro which will copy a worksheet from one Workbook to another using the Worksheets collections Copy method. The source Sheet has formulas which refer to other sheets cells in the Source workbook. The Target workbook also has the same set of worksheets (with the same name) except the one that I am copying. After copying, what I noticed is that the copied sheet still refers to the Source workbook's sheets in all formulas rather than the one present in the current workbook. How do I make it refer to the current workbook and not the source workbook

for e.g.

Source work book (abc.xls) has Sheet1, Sheet2, Sheet3. There is a formula in the Sheet3 which is "=Sheet1!C3*1.12". The target work book (xyz.xls) has Sheet1 and Sheet2. When I open both the workbooks and select the Sheet3 of the abc.xls and say copy to the xyz.xls, the formula in the sheet3 of the xyz.xls becomes "=[abc.xls]Sheet1!C3*1.12". What do I need to do if it has to remain like "=Sheet1!C3*1.12" and not refer to the source file.
 
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
Need help Taking alot data from one sheet (if not blank) and copying toa list on another sheet. Alex Zuniga Excel Worksheet Functions 1 November 25th 09 11:54 PM
formulas copying from sheet to sheet Troy[_2_] Excel Worksheet Functions 6 August 21st 09 06:57 PM
How to retain column width and formulas in copying a sheet smich Excel Discussion (Misc queries) 3 January 15th 09 03:55 PM
Copying an Excel sheet keeping the formulas in the copy linked to Hesham Sharara Excel Discussion (Misc queries) 1 June 23rd 07 11:24 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


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