Excel VBA Internal Linking Problem

Evpat

New Member
Joined
Oct 8, 2009
Messages
13
I'm transferring information from an old workbook to a new updated workbook.

As far as I can tell, the method I'm using works well for everything except one:
If old workbook has 2 sheets (sheet 1, sheet 2), and sheet 2 links to sheet 1, the new workbook wants to link to sheet 1 of the old workbook.

I need to know how to make the link relative to the new workbook and not read the old sheet, as I'm going to use the macro to delete the old workbook and replace it with the new.

Here's what I'm doing:
Code:
Workbooks(Currbook).Sheets(Currsht).Range("B2").Copy Destination:=Workbooks(Handwrit).Sheets(Currsht).Range("B2")

Your expertise is greatly appreciated.

Excel 2007, Windows XP
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hey Excel Gurus!

I figured out what I needed for a single cell. The code below converts the old formula to a string then makes that string the value in the new workbook.

Can somebody tell me a way to do this for a large range without looping through every cell? I may have to resort to the loop, but I'm hoping not to so it doesn't get too slow.

I want to accomplish the same thing on B4:N40

Code:
        strFormula = Workbooks(Currbook).Sheets(Currsht).Range("B2").Formula
        Workbooks(Handwrit).Sheets(Currsht).Range("B2").Value = strFormula
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,752
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top