stuartgb100
Active Member
- Joined
- May 10, 2015
- Messages
- 322
- Office Version
- 2021
- Platform
- Windows
Hi,
I'm helping a friend with a mass of text data that has been imported into Excel.
The data is textual, consisting of bold text followed by unbolded, and forum help has shown me how to split bold from unbold.
However, it now seems there are issues with the imported data, namely
leading and trailing spaces chr 160, extra spaces.
I think I need to deal with these issues before splitting bold/unbold.
I think the sequence should be:
1. remove all chr 160 and replace with " " (a space)
2. remove all but one leading space
3. remove any trailing spaces
4. remove any additional spaces within the cell ( ie 3 becomes 2, then 2 becomes 1)
Now I thought I could do this but whatever I try leaves me with unbolded text.
So now I cannot splt bold and unbold.
The data is in a single column, and I can define the range.
So, for example:
Sub Remove160s()
With activesheet
.Range("B10:B40").Replace Chr(160), " ", xlPart
End With
End Sub
and bold text changes to unbolded.
Thanks.
I'm helping a friend with a mass of text data that has been imported into Excel.
The data is textual, consisting of bold text followed by unbolded, and forum help has shown me how to split bold from unbold.
However, it now seems there are issues with the imported data, namely
leading and trailing spaces chr 160, extra spaces.
I think I need to deal with these issues before splitting bold/unbold.
I think the sequence should be:
1. remove all chr 160 and replace with " " (a space)
2. remove all but one leading space
3. remove any trailing spaces
4. remove any additional spaces within the cell ( ie 3 becomes 2, then 2 becomes 1)
Now I thought I could do this but whatever I try leaves me with unbolded text.
So now I cannot splt bold and unbold.
The data is in a single column, and I can define the range.
So, for example:
Sub Remove160s()
With activesheet
.Range("B10:B40").Replace Chr(160), " ", xlPart
End With
End Sub
and bold text changes to unbolded.
Thanks.