Results 1 to 5 of 5

Macro to automatically add comment boxes

Threaded View

lawlegge Macro to automatically add... 01-20-2013, 08:52 PM
jraj1106 Re: Macro to automatically... 01-21-2013, 12:53 AM
lawlegge Re: Macro to automatically... 01-21-2013, 09:13 PM
jraj1106 Re: Macro to automatically... 01-22-2013, 02:07 AM
lawlegge Re: Macro to automatically... 01-22-2013, 09:55 PM
  1. #1
    Registered User
    Join Date
    01-20-2013
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    3

    Macro to automatically add comment boxes

    Greetings;

    I am using this macro to add comment boxes, containing specific text, to worksheets. I have columns 'A' to 'E' frozen and only add to columns 'F' and beyond by manually setting the 'Range' as needed.


    Sub AddACTS_CONS_RANGE()
    Dim ocel As Range
    On Error Resume Next
    For Each ocel In ActiveSheet.Range("F2:AC100")
      ocel.AddComment.Text Text:="ACTS:" & Chr(10) & Chr(10) & "" & Chr(10) & "CONS:" & Chr(10) & Chr(10) & ""
      ocel.Comment.Shape.TextFrame.Characters(1, 5).Font.Bold = True
      ocel.Comment.Shape.TextFrame.Characters(9, 5).Font.Bold = True
      ocel.Comment.Shape.TextFrame.AutoSize = True
    Next
    End Sub
    What I would like it to do is:
    - only add comment boxes to rows that contain '.wag' (that is-dot wag) in column 'E' - thus leaving all other rows UN-commented.

    Thanking you in advance,
    lawlegge
    Last edited by Leith Ross; 01-20-2013 at 10:32 PM. Reason: Added Code Tags

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