+ Reply to Thread
Results 1 to 7 of 7

Red Dot

Hybrid View

Metrazal Red Dot 03-04-2021, 09:58 AM
jindon Re: Red Dot 03-04-2021, 10:44 AM
Metrazal Re: Red Dot 03-04-2021, 12:30 PM
Fluff13 Re: Red Dot 03-04-2021, 12:50 PM
jindon Re: Red Dot 03-04-2021, 01:03 PM
Metrazal Re: Red Dot 03-04-2021, 01:54 PM
jindon Re: Red Dot 03-04-2021, 01:56 PM
  1. #1
    Forum Contributor
    Join Date
    02-16-2006
    MS-Off Ver
    OFFICE 365
    Posts
    244

    Red Dot

    I have a need, using VBA, to replace certain data in a column with a red dot. In my sample document if a field in column G contains "X", "D", "B", or "E" then it is replaced by a red dot. If it contains another character then the field is cleared. My major obstacle is my inability to replace the characters with a red dot. As always, any help is appreciated.


    Thanks,

    Met
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Red Dot

    One way
    Sub test()
        Application.ScreenUpdating = False
        With Range("g3", Range("g" & Rows.Count).End(xlUp))
            .FormatConditions.Delete
            .Font.ColorIndex = xlAutomatic
            .Value = Evaluate("if(isnumber(search("",""&" & .Address & _
            "&"","","",X,D,B,E,""&char(8572)&"","")),""#N/A"","""")")
            On Error Resume Next
            With .SpecialCells(2, 16)
                .Value = ChrW(9679)
                .Font.Color = vbRed
            End With
            On Error GoTo 0
        End With
        Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-16-2006
    MS-Off Ver
    OFFICE 365
    Posts
    244

    Re: Red Dot

    Hmm. When I run the code listed above it seems to clear all the contents in column G. Let me dig into this a bit deeper, I must be missing something.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,746

    Re: Red Dot

    Try this mod to jindon's code
    Sub test()
        Application.ScreenUpdating = False
        With Range("g3", Range("g" & Rows.Count).End(xlUp))
            .FormatConditions.Delete
            .Font.ColorIndex = xlAutomatic
            .Value = Evaluate("if(isnumber(search("",""&" & .Address & _
            "&"","","",X,D,B,E,""&"","")),""#N/A"","""")")
            On Error Resume Next
            With .SpecialCells(2, 16)
                .Value = ChrW(9679)
                .Font.Color = vbRed
            End With
            On Error GoTo 0
        End With
        Application.ScreenUpdating = True
    End Sub

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Red Dot

    Metrazal

    try change
            .Value = Evaluate("if(isnumber(search("",""&" & .Address & _
            "&"","","",X,D,B,E,""&char(8572)&"","")),""#N/A"","""")")
    to
            .Value = Evaluate("if(isnumber(search("",""&" & .Address & _
            "&"","","",X,D,B,E,""&unichar(9679)&"","")),""#N/A"","""")")

  6. #6
    Forum Contributor
    Join Date
    02-16-2006
    MS-Off Ver
    OFFICE 365
    Posts
    244

    Re: Red Dot

    Perfect. Thanks for the help. I appreciate it.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Red Dot

    Did the change I suggested work?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1