Handle #Name? with VBA

Burnsieboy

New Member
Joined
Aug 19, 2016
Messages
16
Hi all,

I am updating around 90 workbooks for year end by adding an extra named range to an existing formula
I will be doing this by looping through all of the workbooks to add the 18/19 spend in year to 15/16 16/17 17/18

Code:
    Range("HRPreviousYearsSpend").Select
ActiveCell.Replace What:=")", Replacement:=",Year_18_19_Total_Project_Cost_Total_inc_VAT)", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False

My issue is that not all of the workbooks have the new named range in them which will result in #Name ?

Does anyone know of a way to handle it 'live' or run a fix after the updates are complete
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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