Macro to replace certain text

bmoore45

New Member
Joined
Jun 19, 2011
Messages
39
Hey guys

I'm looking for a way to delete any occurence of the letter 'o' in column G of my chart, does anyone know how I can do this?

Cheers,

ben
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hey guys

I'm looking for a way to delete any occurence of the letter 'o' in column G of my chart, does anyone know how I can do this?

Cheers,

ben

You mean, column G of the worksheet?
 
Upvote 0
Hi Ben
Have you considered simply using the Find / Replace function.
Highlight column "G" then
In the find line use "o" without the quotes
and in the replace line, leave it blank.
 
Upvote 0
thanks yeah I mean the worksheet.


Michael:I'm using an ahk program to interact with the worksheet so clicking a hotkey to run a macro that would do this would be more efficient than entering data into the find/replace window imo.

Also I tried this method as it definitely would suffice but I seem to be getting an error. The cells contain formulas, I just want to replace the o's in the values not in the formula
 
Last edited:
Upvote 0
You could then simply record the macro using the macro recorder and the steps I have suggested.
 
Upvote 0
Yeah and that would work fine, except the find and replace tool is the problem for me; if all I wanted to do was find the o's in cell values then that would be simple but in the replace tab the only option for Look in: is "Formulas", so I'm still not sure how to do it. Sorry to be a pain
 
Upvote 0
What kind of formulas do you have in that column?
 
Upvote 0
Yeah and that would work fine, except the find and replace tool is the problem for me; if all I wanted to do was find the o's in cell values then that would be simple but in the replace tab the only option for Look in: is "Formulas", so I'm still not sure how to do it. Sorry to be a pain
You can't have replace change the output from a formula... the output is the output. Just think if you could use Edit/Replace to do that... the next time the worksheet was recalculated, the replaced letter would just pop back in... that's what the formula outputs after all... and since the Replace operation is a manual "thing", it would not re-occur until you manually performed it again... I think you would get real tired trying to keep up with all the recalculations that take place in Excel.:eeek: The way to handle this is to make the replacement take place as part of the formula...

Code:
=SUBSTITUTE([YourFormulaGoesHere]<YOURFORMULAGOESHERE><YOURFORMULAGOESHERE><YOURFORMULAGOESHERE>,"o","X")
where [YourFormulaGoesHere] would be the part after the equal sign, of course, and you would use whatever character or characters you want in place of the letter "o" instead of the "X" that I used. If you just wanted to remove the letters "o", then just use "" instead of "X".
 
Last edited:
Upvote 0
*** message remove as the change i thought i needed to make was not needed ***
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,487
Members
452,917
Latest member
MrsMSalt

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