Replace "+" with ":"

lukerees83

Board Regular
Joined
Mar 28, 2011
Messages
59
In one column of each sheet on my workbook some of the times are written as 21+34 and some are written as 21:34. Don't ask!

To do calculations obviously the + needs to be replaced with a : and I have previously done this on Excel 2003 with no problem, it was a simple find and replace.

I am now on Excel 2011 for Mac and when I do the same thing it says 'the formula you have entered contains an error" etc etc....

It also suggests that if you are not entering a formula you should simply put a single quotation mark ' before the terms you are finding an replacing. So I typed '+ and '+ (I also tried '+' and ':' just in case). In this case it says no match could be found.

How can I make it do this simple F&R?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Have you tried a tilde (~) character in front of the character that you want to replace? That used to be the relevant 'escape' character to use.
 
Upvote 0
VBA

Code:
With Range("A1")
    .Value = Replace(.Value, "+", ":")
End With
 
Upvote 0
You might not have developer tab not enabled, so you might need to go to Excel Options and enable the tab.
Then go to developer tab -> Visual Basic

and then you'll see on the left menu of your sheets,
double click the sheet you want to do the replacing in...
then jut copy and paste the code above into a sub.
Code:
Sub CustomReplace()
    With Range("A1")
    .Value = Replace(.Value, "+", ":")
    End With
End Sub

I'm not too sure if XL2011 for mac has VBA tho...
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,158
Members
452,892
Latest member
yadavagiri

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