pc_abuzer said:
Is there anyway that I can set Excel to allow me to type in a larger bold font (Comic Sans MS??) from the very first keystroke? Or at least, a bold font right away?
Yep, with a little help from VBA.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
In the workbook module:
Option Explicit
Private Sub Workbook_Activate()
Run "MyRightClick"
End Sub
Private Sub Workbook_Open()
Run "MyRightClick"
End Sub
Private Sub Workbook_Deactivate()
Application.CommandBars("Cell").Reset
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Cell").Reset
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
For Each cmt In ActiveSheet.Comments
cmt.Visible = False
Next cmt
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
In a standard module:
Option Explicit
Public cmt As Comment
Private Sub MyRightClick()
Application.CommandBars("Cell").Reset
Dim oBtn As CommandBarButton
With Application.CommandBars("Cell")
Set oBtn = .Controls.Add
oBtn.Caption = "Insert Custom Comment"
oBtn.Style = msoButtonCaption
oBtn.OnAction = "MyComment"
oBtn.BeginGroup = True
End With
End Sub
Private Sub MyComment()
Application.ScreenUpdating = False
With ActiveCell
On Error Resume Next
.Comment.Delete
Err.Clear
Set cmt = .AddComment
.Comment.Visible = True
.Comment.Shape.Select
Dim sWho$, sCmt$
sWho = Application.UserName & ":" & Chr(10)
sCmt = WorksheetFunction.Substitute(sCmt, sWho, "")
With cmt.Shape.TextFrame.Characters.Font
.Bold = True
.Name = "Comic Sans MS"
.ColorIndex = 5
.Size = 14
End With
End With
Application.ScreenUpdating = True
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Then, save the workbook and either
- close it and reopen it
or
- activate another workbook that happens to be open in that same instance of Excel, then re-activate the subject workbook.
Now, right click on any worksheet cell and at the bottom of the pop-up menu will be a special item named "Insert Custom Comment". Left click on that, and a new comment will be added to the target cell, ready for you to enter text that will be in Comic Sans MS, blue font, bold, font size 14 which are settings you can modify in the code.
Notice on the right click pop-up menu, and on the worksheet menu under Insert > Comment, that you still have those same mechanisms in place, in case you or some other user wants to add a boring normal comment, so now you have options.
This will not affect any other Windows settings.