AddyProg
AddyProg

Reputation: 3050

How to get 2nd occurance of a substing in a string VBA

I have cell formula like enter image description here

I want to replace specific # with check# with an integer I have tried this

result = Replace(Cell.formula, "#", i)
  Cell.formula = result

but it also changes the # with #00D700 so I want to get the # which comes after 2nd* sign in cell formula.

Upvotes: 1

Views: 49

Answers (1)

Try Replace(Cell.formula, "check#", "check" & i)

Upvotes: 1

Related Questions