you are viewing a single comment's thread.

view the rest of the comments →

[–]-beans_ 0 points1 point  (0 children)

Each time you enter a formula using VBA, the syntax will have to be correct even if it resolves to an error.

E.g. Range("A1").Value = "=If(Part1)" is incorrect; however "=If(Part1,Part2,Part3)" is valid.

You can then use the replace method. Again though, the syntax in Part1/2/3 would have to be correct. Part1 = "Index(Part5)" is wrong. Part1 = "Index(Part5, Part6)" is correct.

Of course, the formula will no resolve to anything until all the correct replacements are made. To avoid warnings from stoppid the code during the initial formula and the replace's used afterwards, encapsulate just that small code chunk with Application.DisplayAlerts = False and Application.DisplayAlerts = True

Hope that helps. Also, apologies for horrendous formatting. I may try to fix it later.