+ Reply to Thread
Results 1 to 6 of 6

Inserting a comment that has some bold text and some regular text

  1. #1
    Registered User
    Join Date
    08-29-2006
    Posts
    30

    Inserting a comment that has some bold text and some regular text

    I'm trying to add a comment that should look something like:

    MyName:
    Comment by me

    Here's my code:

    Range("J11").Select
    Range("J11").ClearComments
    Range("J11").AddComment
    Range("J11").Comment.Visible = False
    Range("J11").Comment.Text Text:="MyName:" & Chr(10) & "Comment by me"

    How do I get "MyName:" to show up in bold?

    I tried using this but it does the whole comment box:

    Range("J11").Comment.Shape.TextFrame.Characters.Font.Bold = True


    Thanks!

  2. #2
    mpeplow
    Guest
    Hope this helps. http://www.mrexcel.com/archive/VBA/22883.html

  3. #3
    Registered User
    Join Date
    08-29-2006
    Posts
    30
    Thanks, but that didn't help me. I'm just learning how to do this stuff, but maybe what I am asking is not possible. I tried recording a macro for doing this and looking at the code, but the macro doesn't even repeat what I told it to do, so that didn't work.

    Any further help would be greatly appreciated.

  4. #4
    mpeplow
    Guest
    It IS possible, it just not easy at all. Unfortunatly I don't know enough to help you any further, hopefuly some else more experinced than myself will be able to help you with the code. Good Luck.

  5. #5
    Registered User
    Join Date
    08-29-2006
    Posts
    30
    Never mind, I figured it out.

    I was on the right track with this statement:

    Range("J11").Comment.Shape.TextFrame.Characters.Font.Bold = True



    All I had to do was this:

    Range("J11").Comment.Shape.TextFrame.Characters(1,7).Font.Bold = True

    and it sets characters 1-7 bold.


    Like I say, I'm new at this stuff. It's weird that excel wouldn't include that line when I tried recording this macro, though.

  6. #6
    mpeplow
    Guest
    Sweet. Thats one that I will have to remeber. Alot easyer than the other instruction that I found.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1