Results 1 to 2 of 2

Thread: Searching Special Characters

  1. #1

    Searching Special Characters



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi Friends,

    Am having customer data in which some of the name may not be personalized i.e in the name some special characters might have been included (@,?,",%).

    Is there any possibility to check the special characters using macro. The row ranges varies on day to day basis but column range is A to H.Name will be in the H column. If any name contains special characters that row needs to highlighted in the yellow colour.

    Please help me out.

    Regards
    Shyam

  2. #2
    Hi shyamsundar75,
    Can you adapt
    Code:
    option Explicit
    Sub HighlightCells()
        Dim Lookin As Range, ff As String
        Dim Fnd As Variant
        Dim xItem As Variant
        Fnd = Array("@", "~?", "%", """")
                For Each xItem In Fnd
                    Set Lookin = Cells.Find(xItem, Lookin:=xlValues, LookAt:=xlPart)
                    If Not Lookin Is Nothing Then
                        ff = Lookin.Address
                        Do
                           Lookin.Rows.Font.ColorIndex = 3
                            Set Lookin = Cells.FindNext(Lookin)
                        Loop Until ff = Lookin.Address
                    End If
                    Set Lookin = Nothing
         Next
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •