Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default FORMAT COMMENT TEXT WITH MACRO

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FORMAT COMMENT TEXT WITH MACRO

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FORMAT COMMENT TEXT WITH MACRO

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FORMAT COMMENT TEXT WITH MACRO

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FORMAT COMMENT TEXT WITH MACRO

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
comment format whiskeyromeo Excel Discussion (Misc queries) 2 February 18th 10 08:00 PM
Macro-insert text(personal comment) puiuluipui Excel Discussion (Misc queries) 2 September 24th 09 09:45 PM
Decide comment format 'globally'? Restore format with ws_change? tskogstrom Excel Discussion (Misc queries) 0 April 16th 07 09:07 AM
group comment format on text wildlysa Excel Worksheet Functions 1 January 29th 06 02:14 AM
Format a Comment created by a Macro Ken G. Excel Discussion (Misc queries) 3 August 30th 05 07:28 AM


All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"