Mass Find/Replace other worksheet references

lost_in_the_sauce

Board Regular
Joined
Jan 18, 2021
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Trying to update about 200 cells that reference another workbook - looks like this:

='F:\AOP\Monthly P&L\FY21\P8 - Feb 21\[FY21 P8 - Presentation.xlsx]Sales'!$DR$8

And I want to change every cell to this:

='F:\AOP\Monthly P&L\FY21\P9 - Mar 21\[FY21 P9 - Presentation.xlsx]Sales'!$DR$8

When I do they, for every cell it creates a pop-up to point at the new workbook. Is there a way around that since normally it changes everything and lets me know how many and the file reference change wants more?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
In vba try the following code.....

VBA Code:
Sub lost()
Application.DisplayAlerts = False
For x = 1 To 34
    Cells(x, 1).Select
    Sheets("Sheet1").Cells(x, 1).Replace What:="='F:\AOP\Monthly P&L\FY21\P8 - Feb 21\[FY21 P8 - Presentation.xlsx]Sales'!$DR$8", _
                    Replacement:="='F:\AOP\Monthly P&L\FY21\P9 - Mar 21\[FY21 P9 - Presentation.xlsx]Sales'!$DR$8"
Next x

Application.DisplayAlerts = True
End Sub


this will change your text in each cell if it ='F:\AOP\Monthly P&L\FY21\P8 - Feb 21\[FY21 P8 - Presentation.xlsx]Sales'!$DR$8 to "='F:\AOP\Monthly P&L\FY21\P9 - Mar 21\[FY21 P9 - Presentation.xlsx]Sales'!$DR$8", while displayalerts = false statements hides all alerts...


hope this helps.
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

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