Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hidden Character | Excel Worksheet Functions | |||
Excel-Match 1st text character in a string to a known character? | Excel Worksheet Functions | |||
Hidden Character Find Macro Help | Excel Programming | |||
How do I delete hidden character in Excel? | Excel Discussion (Misc queries) | |||
Function to return Character Position of Xth character within a string | Excel Programming |