Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Macro to delete 'tick' Character

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--

--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro to delete 'tick' Character

Hi,

=code(a1)

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

Mike

"ryguy7272" wrote:

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--

--
RyGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Macro to delete 'tick' Character

Excellent!!!
Thanks!
Ryan--

"Mike H" wrote:

Hi,

=code(a1)

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

Mike

"ryguy7272" wrote:

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--

--
RyGuy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete everything after a certain character [email protected] Excel Programming 4 November 21st 06 09:04 PM
Tick Box Macro Vlad999 Excel Programming 0 April 18th 06 06:26 AM
Excel Macro to edit and delete one character in a cell David Excel Programming 5 December 8th 04 12:02 PM
unticking a tick box within a macro The Grinch[_5_] Excel Programming 6 July 20th 04 01:52 PM
Delete everything after a certain character? Chris Excel Programming 2 June 18th 04 09:59 PM


All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"