Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Automation of a particular task in Excel 2010

    Hey guys

    I'm new here and am absolutely clueless in scripting and automation of tasks not supported through the macros.

    Here is what I want to do, but don't know where I can find the information I need to proceed:

    Right click cell > Insert Comment
    Right click comment border > Format Comment > Navigate to Colors and Lines > Under fill open the color drop down menu > Select Fill Effects > Navigate to Picture tab > click Select picture (and if possible navigate to desktop view and at this point be ready to accept user input to select an image)

    I'm almost positive this is technically doable. But how?

    I appreciate your time and help in advance

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    For example:
    Code:
    Sub AddPicComment()
       Dim varPic
       varPic = Application.GetOpenFilename(filefilter:="Image files (*.bmp; *.jpg; *.gif; *.png), *.bmp; *.jpg; *.gif; *.png", _
                                              Title:="Select picture file", MultiSelect:=False)
       If varPic <> False Then
          If ActiveCell.Comment Is Nothing Then
             ActiveCell.AddComment
          End If
          ActiveCell.Comment.Shape.Fill.UserPicture varPic
       End If
    End Sub
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    New Lounger
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thank you so much and just to prevent any trouble and reworks, how would I go about implementing and executing this code? uh I feel like such a noob lol

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Do you have a personal macro workbook? If so, add the code to there, then either add a button to the Quick Access Toolbar to run the macro, or add one to the Ribbon. If not, create a Personal macro workbook (easiest way is just to start recording a macro, choose to save it in a personal macro workbook, then just stop recording).
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    New Lounger
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up FANtastic!

    Quote Originally Posted by rory View Post
    Do you have a personal macro workbook? If so, add the code to there, then either add a button to the Quick Access Toolbar to run the macro, or add one to the Ribbon. If not, create a Personal macro workbook (easiest way is just to start recording a macro, choose to save it in a personal macro workbook, then just stop recording).
    U R AWESOME RORY!

    Thank you so much, you can't believe how much easier my job has just become (=

    how do i give u "thanks" though, I'm new and looked around but couldn't find anything cept for thread rating. gave it excellent.

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    how do i give u "thanks" though, I'm new and looked around but couldn't find anything cept for thread rating
    On the left side of the post, near the bottom, underneath the user name is a "Thanks" button...

    Steve

Posting Permissions

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