Search for Special Characters

  • Thread starter Thread starter Clark Murray
  • Start date Start date
C

Clark Murray

Is there any way to search for special characters in Excel, like a tab, for example? I haven't been able to find one.
 
To my knowledge, it's not possible to have a tab character in Excel. I do believe, however, that the TRIM function gets rid of non-printing characters.

<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
Hope this helps!
Anne Troy (better known as Dreamboat)
Author: Dreamboat on Word
Email: Dreamboat*at*Piersontech.com
Web: www.TheOfficeExperts.com
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
Is there any way to search for special characters in Excel, like a tab, for example? I haven't been able to find one.
 
Sometimes you can use the Find dialog and type the character code equivalent.

alt-0010 is the same as Alt-Enter
alt-0009 is the tab

But it didn't work for me for the tab character. But a little macro did:

Option Explicit
Sub testme()

Dim FoundCell As Range
Dim FindWhat As String

FindWhat = vbTab 'chr(9)

With ActiveSheet
Set FoundCell = .Cells.Find(What:=FindWhat, _
After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False)

If FoundCell Is Nothing Then
MsgBox "Not found"
Else
MsgBox "found at: " & FoundCell.Address(0, 0)
FoundCell.Activate
End If
End With

End Sub

But Tabs in excel aren't really supported within cells. They don't work like
tabs in Word do.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Back
Top