Macro to delete 'tick' Character

R

ryguy7272

A couple of days ago Gord Dibben gave me a macro to delete all 'hard
returns'. The code is below:

Sub Remove_CR_LF()
With Selection
..Replace What:=Chr(39), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(146) & Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(180), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End With
End Sub

The macro works great and I was trying to play with it to get it to delete
all tick marks, which are those little characters that appear at the front of
text, and some numbers, when you do a copy/paste special. I tried to
identify the character by putting 1-256 in a column and referencing each cell
with the =char() function. I wanted to find the appropriate identifier and
then add it in the parentheses in:
..Replace What:=Chr(39),

I can't seem to find the identifier for these characters though. I thought
it may be 39, 96, 145, or 146, but none of these seem to work. What am I
doing wrong?

Ryan--
 
M

Mike H

Hi,

=code(a1)

returns the ascii code of a character so identify your character with that.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top