Hello,
I have cells with a1 + 1, a2 + 1 etc. But i have like a million cells with this formula. Now i would like to change the sum from + 1 to + 6, but i would do this with a VBA code (maybe replace). But otherwise excel doesn't keep working.
Hello,
I have cells with a1 + 1, a2 + 1 etc. But i have like a million cells with this formula. Now i would like to change the sum from + 1 to + 6, but i would do this with a VBA code (maybe replace). But otherwise excel doesn't keep working.
Hello,
You may be able to do that with a find and replace operation rather than VBA.
Hit Ctrl-H to open the Find and Replace dialog.
In the "Find what" box enter "+1" (without the quotes)
In the "Replace with" box, enter "+6" (without the quotes)
Ensure that the "Look in" drop-down is set to "Formulas"
Hit "Replace All"
To avoid this situation in the future, you could create a named formula for the number you want to add. Use the Name Manager and create a name. Call it, for example "AddMe" and in the "Refers to" box enter the number, i.e. 6.
Now do a find and replace. With your original formula that has the +1, find the +1 and replace it with +AddMe.
The next time you need to change the value, open the Name Manager, edit the AddMe name and change its value. Each formula that refers to the name "AddMe" will then use the new value you specified.
Let me know if this helps.
cheers, teylyn
Thnx for your input.
The replace all i tried, but i couldn't be done in one time. Excel didn't like that.
That's why i would like to have that replace formula in vba.
You can use the Record Macro feature and try to record the Find & Replace feature, then perhaps tweak the code for better performance.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks