Link changes data range

erutherford

Active Member
Joined
Dec 19, 2016
Messages
449
Workbook A is linked to another workbook (call it B). Workbook B data changes daily. Workbook A reads and formats that data for numerous reports. An updated Workbook B file is available. Workbook A runs a couple of simple macros to format the worksheet. The formulas in workbook A change to read Workbook B before and not after formatting. Should I break the link and add code to do it?
Here is sample of the code
VBA Code:
=COUNTIFS([regdwnld.xlsx]export!D:D,"Street", [regdwnld.xlsx]export!H:H,"Open")
It should read I:Iexport!, but it gets changed to D:D! - H:H changes from I:I
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
After some testing, the problem occurs when the macro that reorders the columns runs. This causes the formula to look at the wrong columns. Don't rearrange the columns, formulas are happy. For now I can live with the order of the columns as they are and continue on with the project.
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,699
Members
449,117
Latest member
Aaagu

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