How to use `Google Code Prettifier` to VBA macro in Microsoft Excel?

rediffusion

Board Regular
Joined
Apr 24, 2019
Messages
60
Cross-post!

I have some VBA macro for "Inserting Note" in Microsoft Excel. I want this
prettifier to be inserted in my macro for creating a note with highlighting, is it possible (Interested in highlighting such as on StackOverflow)? Watched a video 1, 2, - on YouTube but the manual is not relevant it's for the site... :(

Screenshot

Code:
[COLOR=#24292E][FONT=SFMono-Regular]Sub Special_Note_White()[/FONT][/COLOR]
<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; background: transparent; border-radius: 3px; margin: 0px; padding: 0px; border: 0px; word-break: normal; display: inline; line-height: inherit; overflow: visible; overflow-wrap: normal;">Dim myComm As Comment
  If Not ActiveCell.Comment Is Nothing Then
    If MsgBox("The cell already contains a note, delete?", 4) - 7 Then
      ActiveCell.Comment.Delete
    Else: Exit Sub
    End If
  End If

Set myComm = ActiveCell.AddComment
    With myComm.Shape
      .Height = 110
      .Width = 200
      .AutoShapeType = 1
      .Fill.ForeColor.SchemeColor = 1
      .Line.ForeColor.RGB = RGB(255, 0, 0)
      .DrawingObject.Font.Name = "Consolas"
      .DrawingObject.Font.FontStyle = "normal"
      .DrawingObject.Font.Size = 8
     End With
      'Emulate the choice of "Edit Note".
       SendKeys "+{F2}" 
</code>[COLOR=#24292E][FONT=SFMono-Regular]End Sub[/FONT][/COLOR]

For example MS WORD has `Code Syntax Highlighting` i want something for MS EXCEL.

Screenshot ··· highlighting for MS WORD.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,213,546
Messages
6,114,253
Members
448,556
Latest member
peterhess2002

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