Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 331
Default adding cell comment via VBA (bold font?)

Hi,

Is there a way to make part of a cell comment bold (user name in particular)
when a comment is being added via VBA?

Thanks,
--
______
Regards,
Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default adding cell comment via VBA (bold font?)

To change the comment text to bold:
ActiveCell.Comment.Shape.TextFrame.Characters.Font .Bold = True


"Greg" wrote:

Hi,

Is there a way to make part of a cell comment bold (user name in particular)
when a comment is being added via VBA?

Thanks,
--
______
Regards,
Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 331
Default adding cell comment via VBA (bold font?)

how about only part of the comment?

for instant:
John Smith:
this cell has a comment


--
______
Regards,
Greg


"Anony" wrote:

To change the comment text to bold:
ActiveCell.Comment.Shape.TextFrame.Characters.Font .Bold = True


"Greg" wrote:

Hi,

Is there a way to make part of a cell comment bold (user name in particular)
when a comment is being added via VBA?

Thanks,
--
______
Regards,
Greg

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default adding cell comment via VBA (bold font?)

I'm using the Application.UserName here, but the principle's the same. Go by
character lengths:

Sub FormatCmt()
Dim Cmt As Comment
Dim YourName As String
Dim Text As String

Text = "Here's your comment."
With ActiveCell
YourName = Application.UserName & ":" & vbLf
Set Cmt = .AddComment(YourName & Text)
With Cmt.Shape.TextFrame
.Characters.Font.Bold = False
.Characters(1, Len(YourName)).Font.Bold = True
End With
End With
End Sub

-----------------
Cheers,
Anony
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
if font is bold then cell value is number Jon Excel Discussion (Misc queries) 1 September 13th 08 11:50 AM
How to count number of Cell have Strike Through Effect & Bold as font style. Akash Maheshwari Excel Discussion (Misc queries) 6 June 29th 07 09:39 PM
Can you keep a cells BOLD Font, cell color size Trese Excel Discussion (Misc queries) 2 August 23rd 05 03:09 PM
change font size and bold in cell? R Doornbosch Excel Programming 7 February 10th 04 12:03 AM
Using bold and normal font within one cell Paul Excel Programming 2 January 8th 04 07:06 PM


All times are GMT +1. The time now is 07:17 AM.

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

About Us

"It's about Microsoft Excel"