+ Reply to Thread
Results 1 to 4 of 4

Macro: IF given range contains a comment box, then copy cell D1 and paste.

  1. #1
    Registered User
    Join Date
    08-06-2011
    Location
    Oakville, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Macro: IF given range contains a comment box, then copy cell D1 and paste.

    Hi all,

    I was hoping to get some help on the VBA code to write a macro that will:

    Search in range ($H$13:$H$14) for a comment box and IF there is a comment box it will then select cell $D$1 and open a document such as: notepad/word or even a new excel sheet and paste the contents of D1(string).

    Thanks.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Macro: IF given range contains a comment box, then copy cell D1 and paste.

    Hi there,

    Take a look at the attached code and see if it gets you going in the right direction.

    If a comment exists for any of the cells in the range specified by "sSheetToSearch" and "sRangeToSearch", the contents of the cell specified by "sSourceSheet" and "sSourceCell" will be copied to the cell specified by "sTargetSheet" and "sTargetCell".

    Please Login or Register  to view this content.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    08-06-2011
    Location
    Oakville, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro: IF given range contains a comment box, then copy cell D1 and paste.

    Hi Greg,

    Sorry, I dont think i was clear on the first post. I was hoping that the macro searched first through cell range (H13:H14) then if there was a comment box paste cell D1 Value by opening another excel sheet and if not(most likely the case), move on to the next cell range of (I13:I14). and so on untill range (AE13: AE14).

    Thanks for your help

    -Azhar

  4. #4
    Registered User
    Join Date
    08-06-2011
    Location
    Oakville, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro: IF given range contains a comment box, then copy cell D1 and paste.

    Greg- can you clarify what you mean by "how I get on?"

    Thanks

+ 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