Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default hidden character in string

I am serching for a string but the string seems to have an invisible control
character - probably Chr(13) or something of the like at the end. My script
is :

Range("A2").Select 'Set for start range
Do Until ActiveCell = ""
If ActiveCell = "Gobbledegook" Then 'Test to find
vText = ActiveCell.Offset(1, 0).Value 'Grab data
ActiveCell.Offset(1, 14) = vText ' Copy it
End If

With this hidden character I cannot use the search! How can I find the cell
ignoring the character(s)

Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default hidden character in string

Hi Richard,

Perhaps, try something like:

'=============
Public Sub Tester()
If InStr(1, ActiveCell.Value, _
"Gobbledook", vbTextCompare) = 0 Then
'your code
End If
End Sub
'<<=============


---
Regards,
Norman


"Syscon" wrote in message
...
I am serching for a string but the string seems to have an invisible
control
character - probably Chr(13) or something of the like at the end. My
script
is :

Range("A2").Select 'Set for start range
Do Until ActiveCell = ""
If ActiveCell = "Gobbledegook" Then 'Test to find
vText = ActiveCell.Offset(1, 0).Value 'Grab data
ActiveCell.Offset(1, 14) = vText ' Copy it
End If

With this hidden character I cannot use the search! How can I find the
cell
ignoring the character(s)

Richard



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default hidden character in string

Hi Richard,

Additionally, if you wish to identify individual characters, you may wish to
consider Chip Pearson's Cell View add-in:

http://www.cpearson.com/Excel/CellView.htm



---
Regards,
Norman


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default hidden character in string

The CellView add in has identified ( info - works in excell 2007 ) decimal
010 at the end of the text.
Is there anyway to strip this from all cells in Col. A to enable my search
to run?. I have a lot of individual Excel sheets to run my macro on!

Richard

"Norman Jones" wrote:

Hi Richard,

Additionally, if you wish to identify individual characters, you may wish to
consider Chip Pearson's Cell View add-in:

http://www.cpearson.com/Excel/CellView.htm



---
Regards,
Norman



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default hidden character in string

Hi Richard,

Try something like:

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet

Set WB = Workbooks("MyBook.xls") '<<==== CHANGE
For Each SH In WB.Worksheets
SH.Columns("A").Replace _
What:=Chr(10), _
Replacement:=vbNullString, _
SearchOrder:=xlByRows, _
Lookat:=xlPart
Next SH
End Sub
'<<=============

---
Regards,
Norman
Microsoft Excel MVP



"Syscon" wrote in message
...
The CellView add in has identified ( info - works in excell 2007 )
decimal
010 at the end of the text.
Is there anyway to strip this from all cells in Col. A to enable my search
to run?. I have a lot of individual Excel sheets to run my macro on!

Richard

"Norman Jones" wrote:

Hi Richard,

Additionally, if you wish to identify individual characters, you may wish
to
consider Chip Pearson's Cell View add-in:

http://www.cpearson.com/Excel/CellView.htm



---
Regards,
Norman







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default hidden character in string

Thanks for the very fast reply !
And if I just want to strip it from the open worksheet? ( as some worksheets
have "memo" fields with a free form entrys that I do not want striped )
Presumably it is a change to :-
SH.Columns("A").Replace _

Richard
"Syscon" wrote:

I am serching for a string but the string seems to have an invisible control
character - probably Chr(13) or something of the like at the end. My script
is :

Range("A2").Select 'Set for start range
Do Until ActiveCell = ""
If ActiveCell = "Gobbledegook" Then 'Test to find
vText = ActiveCell.Offset(1, 0).Value 'Grab data
ActiveCell.Offset(1, 14) = vText ' Copy it
End If

With this hidden character I cannot use the search! How can I find the cell
ignoring the character(s)

Richard

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default hidden character in string

Hi Richard,

Try:

'=============
Public Sub Tester()
Activesheet.Columns("A").Replace _
What:=Chr(10), _
Replacement:=vbNullString, _
SearchOrder:=xlByRows, _
Lookat:=xlPart
End Sub
'<<=============


---
Regards,
Norman


"Syscon" wrote in message
...
Thanks for the very fast reply !
And if I just want to strip it from the open worksheet? ( as some
worksheets
have "memo" fields with a free form entrys that I do not want striped )
Presumably it is a change to :-
SH.Columns("A").Replace _

Richard



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default hidden character in string

Norman,
Works a treat. Thank you for the very fast replies.

"Norman Jones" wrote:

Hi Richard,

Try:

'=============
Public Sub Tester()
Activesheet.Columns("A").Replace _
What:=Chr(10), _
Replacement:=vbNullString, _
SearchOrder:=xlByRows, _
Lookat:=xlPart
End Sub
'<<=============


---
Regards,
Norman


"Syscon" wrote in message
...
Thanks for the very fast reply !
And if I just want to strip it from the open worksheet? ( as some
worksheets
have "memo" fields with a free form entrys that I do not want striped )
Presumably it is a change to :-
SH.Columns("A").Replace _

Richard




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
Hidden Character Sandy Excel Worksheet Functions 2 July 25th 07 05:32 PM
Excel-Match 1st text character in a string to a known character? bushlite Excel Worksheet Functions 2 January 15th 07 06:36 PM
Hidden Character Find Macro Help mvyvoda Excel Programming 6 January 14th 06 08:06 PM
How do I delete hidden character in Excel? Isa Excel Discussion (Misc queries) 3 November 15th 05 04:29 PM
Function to return Character Position of Xth character within a string Andibevan[_2_] Excel Programming 4 June 9th 05 03:24 PM


All times are GMT +1. The time now is 02:06 AM.

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

About Us

"It's about Microsoft Excel"