Replace 'Inserted' Symbol with standard text

DJ Peterson

New Member
Joined
Jan 23, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet that is processed in a VBA program that takes the data line-by-line and after validation, uploads it to a server. I'm using ActiveX Data Objects 2.8 to upload to the server. It seems that either ADO or the server does not like any 'Inserted characters'. I need to search each cell to see if there is any symbol in the string that was placed there by using 'Insert Symbol' in Excel. If found, then I will replace the symbol with text representing that symbol (character). For Instance I need to find any occurance of the Omega symbol 'Ω' and replace it with Ohm. I can't figure out how to use InStr() or Replace() to find it. The Omega symbol is a hex 2126 or decimal 8486. I've tried chr(8486) and chrW(8486) but none of these work. An example of the string data in a cell is 'R1 10kΩ, R2 10kΩ, 50V, NPN+NPN'.

Any one have any ideas?

Thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi

I wrote in A1:

R1 10kΩ, R2 10kΩ, 50V, NPN+NPN

and executed:

VBA Code:
Sub test()
Dim s

s = Replace(Range("A1").Value, ChrW(8486), "Ohm")
MsgBox s

End Sub

the message box displayed:

R1 10kOhm, R2 10kOhm, 50V, NPN+NPN

Please try.
 
Upvote 0
The standard search/replace using Ctrl H works for me.
Just copy/paste the symbol into the find what box.
 
Upvote 0
To pgc01: - You are right. I was so focused on the function that I did not see that I was putting the result in the wrong cell; I did not have the Offset for the resulting cell. My assumption was that it was not working.

ActiveCell.Value = Replace(ActiveCell.Offset(0,16).value, chrW(8486), "Ohm")

To Fluff: - I was asking for a VBA solution not an interactive solution, but thanks anyway.
 
Upvote 0

Forum statistics

Threads
1,214,592
Messages
6,120,433
Members
448,961
Latest member
nzskater

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