Change B3:78/3 to B3[78].3 using find and replace or similar command

Copper Contributor

Hi, looking have a large file with data that looks like such..

B3:78/2

B3:78/3

and so on...

email pic delete me 1.PNG

I want to change them as quickly as possible to look like

B3[78].2

B3[78].3

email pic delete me 2.PNG

Can I change all at once, certain aspects of data in cells rather than have to do them one at a time?

Specifically, changint the ":" to "[ ]" and the "/" to "."

 

1 Reply

@Deen Brown 

Hi Deen,

you can do it with the following macro - look at the attached file, too.

 

Sub ReplacePart()

With Sheet1

.Range("A:A").Replace What:=":", Replacement:="[", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True

.Range("A:A").Replace What:="/", Replacement:="].", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True

End With

End Sub

 

Best regards from germany

Bernd

www.vba-Tanker.com - a database full of macros