How to continue macro if there is an error value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro which replaces the file name in a formula. Sometimes the new
file name does not yet exist and the "Update Value.." box pops up. I hit
CANCEL and the macro continues. Is there a line of code which will cause the
macro to hit cancel and continue without any input from me. I came across
the following code but don't know what to put after THEN
If IsError(ActiveCell.Value) Then

Thanks
 
You can use Dir to check if the file exist before you replace the value in the formula

If Dir(FileCell.Value) <> "" Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top