PC Review


Reply
Thread Tools Rate Thread

adding cell comment via VBA (bold font?)

 
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      20th Jul 2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5vbnk=?=
Guest
Posts: n/a
 
      20th Jul 2007
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

 
Reply With Quote
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      20th Jul 2007
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

 
Reply With Quote
 
=?Utf-8?B?QW5vbnk=?=
Guest
Posts: n/a
 
      20th Jul 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
if font is bold then cell value is number Jon Microsoft Excel Misc 1 13th Sep 2008 11:50 AM
Can you keep a cells BOLD Font, cell color size =?Utf-8?B?VHJlc2U=?= Microsoft Excel Misc 2 23rd Aug 2005 03:09 PM
change font size and bold in cell? R Doornbosch Microsoft Excel Programming 7 10th Feb 2004 12:03 AM
Using bold and normal font within one cell Paul Microsoft Excel Programming 2 8th Jan 2004 07:06 PM
can I use css to change font in one cell to bold? Catherine Jo Morgan Microsoft Frontpage 4 27th Aug 2003 02:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:28 AM.