Macro to bold certain text in Message Box

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,589
Office Version
  1. 2021
Platform
  1. Windows
I have the following code below

I would like to have Yes and NOT in bold when message box pops up when code is activated

It would be appreciated if someone could kindly amend my code

Code:
 Sub Formula_checks()
    Dim response As Variant
    
    
response = MsgBox("Select " & vbBold & "Yes" & vbBold & " if data has has " & vbBold & "NOT" & vbBold & " been imported for the first time this month? Click Yes to run the code, or No to exit.", vbYesNo + vbQuestion, "Data Check")

    If response = vbYes Then
       
        Dim ws As Worksheet
        Dim Lr As Long
        
        Set ws = ThisWorkbook.Sheets("Import Templates last updated")
        Lr = ws.Cells(ws.Rows.count, "A").End(xlUp).Row
        
        ws.Range("D1:D" & Lr).formula = "=IFERROR(VLOOKUP(C1,'Reports Ready for checking'!C:E,COLUMNS(C:E),FALSE),"""")"
   ws.Range("D1:D" & Lr).Value = ws.Range("D1:D" & Lr).Value
    Else
        Exit Sub ' Exit the subroutine if the user chooses not to run the code
    End If
End Sub [code]
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
You can't directly apply formatting to text in a MsgBox.
However, you can create a custom UserForm that mimics a message box and allows you to format text.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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