Change red color letters by bold red color letters with underline

MocLinh

New Member
Joined
Apr 28, 2023
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Hi all,

I would like to change the red color letters in excel by bold red color letters with underline. How should I do?

Example as in the image attached.

Thank you a lot for your support,

MocLinh
 

Attachments

  • excel.png
    excel.png
    6.7 KB · Views: 5

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Welcome to Mr Excel.

This code will ask you to select the range and then make the changes that you need to all cells in that range.

It assumes a particular colour red.

If it does not work then we need to find out what colour red is being used.

VBA Code:
Public Sub subReformatCellValues()
Dim i As Integer
Dim rngSelected As Range
Dim rng As Range

    ActiveWorkbook.Save
    
    On Error Resume Next
    Set rngSelected = Application.InputBox(Title:="Reformatting cell values.", _
      Prompt:="Select the range of cells to reformat.", Type:=8)
    On Error GoTo 0

    If rngSelected Is Nothing Then
        Exit Sub
    End If
    
    For Each rng In rngSelected.Cells
    
        For i = 1 To Len(rng)
            If rng.Characters(i, 1).Font.Color = RGB(255, 0, 0) Then
                rng.Characters(i, 1).Font.Underline = True
                rng.Characters(i, 1).Font.Bold = True
            End If
        Next i
    
    Next rng

End Sub
 
Upvote 0
Solution
Another option - where you specify the range of interest (and sheet name) in the code.

VBA Code:
Option Explicit
Sub Change_Format()
    Dim ws As Worksheet
    Set ws = Worksheets("Sheet2")   '<~~ *** Change to actual sheet name ***
    Dim c As Range, i As Long
    
    For Each c In ws.Range("A1").CurrentRegion '<~~ *** Change range to actual range ***
        For i = 1 To Len(c)
            If c.Characters(i, 1).Font.Color = vbRed Then
                With c.Characters(i, 1)
                    .Font.Bold = True
                    .Font.Underline = True
                End With
            End If
        Next i
    Next c
End Sub
 
Upvote 0
Welcome to Mr Excel.

This code will ask you to select the range and then make the changes that you need to all cells in that range.

It assumes a particular colour red.

If it does not work then we need to find out what colour red is being used.

VBA Code:
Public Sub subReformatCellValues()
Dim i As Integer
Dim rngSelected As Range
Dim rng As Range

    ActiveWorkbook.Save
   
    On Error Resume Next
    Set rngSelected = Application.InputBox(Title:="Reformatting cell values.", _
      Prompt:="Select the range of cells to reformat.", Type:=8)
    On Error GoTo 0

    If rngSelected Is Nothing Then
        Exit Sub
    End If
   
    For Each rng In rngSelected.Cells
   
        For i = 1 To Len(rng)
            If rng.Characters(i, 1).Font.Color = RGB(255, 0, 0) Then
                rng.Characters(i, 1).Font.Underline = True
                rng.Characters(i, 1).Font.Bold = True
            End If
        Next i
   
    Next rng

End Sub
Hi Herakles,

I did it.

Thank you very much.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top