Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i need to enter as a comment two words with the "Enter key" press between
the words. This i can do But i want to format the text in the comment box. i.e top word in Arial 14 bold in blue and the bottom word in Arial 14 bold in pink. is this possible - Code would be a great help if possible Sunil |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Turn on the macro recorder and do it manually. Should give you what you
need. -- Regards, Tom Ogilvy "Sunil Patel" wrote in message ... i need to enter as a comment two words with the "Enter key" press between the words. This i can do But i want to format the text in the comment box. i.e top word in Arial 14 bold in blue and the bottom word in Arial 14 bold in pink. is this possible - Code would be a great help if possible Sunil |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pantel informed me it didn't record and he is correct.
Sub AddCustomComment() On Error Resume Next ActiveCell.Comment.Delete On Error GoTo 0 Set cmt = ActiveCell.AddComment( _ Text:="ABCD" & Chr(10) & "EFHG") With cmt.Shape.TextFrame.Characters(1, 4) .Font.Name = "Arial" .Font.Bold = True .Font.ColorIndex = 5 End With With cmt.Shape.TextFrame.Characters(6, 4) .Font.Name = "Arial" .Font.Bold = True .Font.ColorIndex = 7 End With End Sub -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... Turn on the macro recorder and do it manually. Should give you what you need. -- Regards, Tom Ogilvy "Sunil Patel" wrote in message ... i need to enter as a comment two words with the "Enter key" press between the words. This i can do But i want to format the text in the comment box. i.e top word in Arial 14 bold in blue and the bottom word in Arial 14 bold in pink. is this possible - Code would be a great help if possible Sunil |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right you a
Sub AddCustomComment() On Error Resume Next ActiveCell.Comment.Delete On Error GoTo 0 Set cmt = ActiveCell.AddComment( _ Text:="ABCD" & Chr(10) & "EFHG") With cmt.Shape.TextFrame.Characters(1, 4) .Font.Name = "Arial" .Font.Bold = True .Font.ColorIndex = 5 End With With cmt.Shape.TextFrame.Characters(6, 4) .Font.Name = "Arial" .Font.Bold = True .Font.ColorIndex = 7 End With End Sub Your interpretation of pink may be different from mine, so adjust the last colorIndex value from 7 to your definition. Adjust the numbers in Characters to reflect the length of the words you add in the comment. -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... Turn on the macro recorder and do it manually. Should give you what you need. -- Regards, Tom Ogilvy "Sunil Patel" wrote in message ... i need to enter as a comment two words with the "Enter key" press between the words. This i can do But i want to format the text in the comment box. i.e top word in Arial 14 bold in blue and the bottom word in Arial 14 bold in pink. is this possible - Code would be a great help if possible Sunil |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Left out the size 14
Sub AddCustomComment() On Error Resume Next ActiveCell.Comment.Delete On Error GoTo 0 Set cmt = ActiveCell.AddComment( _ Text:="ABCD" & Chr(10) & "EFHG") With cmt.Shape.TextFrame.Characters(1, 4) .Font.Name = "Arial" .Font.Size = 14 .Font.Bold = True .Font.ColorIndex = 5 End With With cmt.Shape.TextFrame.Characters(6, 4) .Font.Name = "Arial" .Font.Size = 14 .Font.Bold = True .Font.ColorIndex = 7 End With End Sub -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... Right you a Sub AddCustomComment() On Error Resume Next ActiveCell.Comment.Delete On Error GoTo 0 Set cmt = ActiveCell.AddComment( _ Text:="ABCD" & Chr(10) & "EFHG") With cmt.Shape.TextFrame.Characters(1, 4) .Font.Name = "Arial" .Font.Bold = True .Font.ColorIndex = 5 End With With cmt.Shape.TextFrame.Characters(6, 4) .Font.Name = "Arial" .Font.Bold = True .Font.ColorIndex = 7 End With End Sub Your interpretation of pink may be different from mine, so adjust the last colorIndex value from 7 to your definition. Adjust the numbers in Characters to reflect the length of the words you add in the comment. -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... Turn on the macro recorder and do it manually. Should give you what you need. -- Regards, Tom Ogilvy "Sunil Patel" wrote in message ... i need to enter as a comment two words with the "Enter key" press between the words. This i can do But i want to format the text in the comment box. i.e top word in Arial 14 bold in blue and the bottom word in Arial 14 bold in pink. is this possible - Code would be a great help if possible Sunil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
comment format | Excel Discussion (Misc queries) | |||
Macro-insert text(personal comment) | Excel Discussion (Misc queries) | |||
Decide comment format 'globally'? Restore format with ws_change? | Excel Discussion (Misc queries) | |||
group comment format on text | Excel Worksheet Functions | |||
Format a Comment created by a Macro | Excel Discussion (Misc queries) |