VBA Non Breaking Space Alt0160

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,514
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
I have a large set of names, and I need to Transpose those into Last Name, First Name. 800 of which have either two first or split last names. I'm currently going through and adding an underscore _ but really want to convert the underscore to the non-breaking space.

Everything I have tried so far is not working and I know it must be simple

.Replace What:="_", Replacement:=Char(160), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End With

pointers please
 

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,203
Office Version
  1. 365
Platform
  1. Windows
It should be Chr(160), Char is the Xl version
 
Last edited:

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,514
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
lol **** my eyes. ta
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,203
Office Version
  1. 365
Platform
  1. Windows

Watch MrExcel Video

Forum statistics

Threads
1,108,808
Messages
5,524,995
Members
409,615
Latest member
papaluigi94

This Week's Hot Topics

Top