Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to copy a worksheet from one workbook to another.

Status
Not open for further replies.

fiat2

Programmer
Nov 26, 2002
104
US
hello all.
Using Excel 2002.

I am trying to copy a worksheet from a workbook and I would like the formulas in this worksheet to reference the new workbook rather than the old one.

Code:
-Worksheet1 has formulas that reference WorksheetABC
-Copy Worksheet1 from Workbook1
-Insert Worksheet1 into Workbook2
-Have Worksheet1 formulas reference [Workbook2].WorksheetABC

How can I achieve this?

Thanks.
 




Use Find > Replace to change the referece to the external workbook.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip,
It can't be that. Common sense would have made me think about that first. Any other ideas?

Sometimes the answer is right in front of you, you just don't have to overthink things.

Thanks for posting the solution and for not harping on me for missing the obvious.

Thanks again and enjoy!







 
It can't be that
Why ?
The Replace method search formulas, not values ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can copy formulas between worksheets:
Code:
Dim ws1 As Worksheet, ws2 As Worksheet
' use proper worksheet references instead
Set ws1 = ActiveSheet
Set ws2 = Application.Workbooks.Add.Worksheets(1) 
ws2.Range(ws1.UsedRange.Address).Formula = ws1.UsedRange.Formula


combo
 
All,
I thank you for looking at this post but Skip's solution worked.

I guess my sarcasm didn't come across as intended.....




 
Might be wrong but I thought you could also do this with Edit,Links Change Source.

Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top