+ Reply to Thread
Results 1 to 6 of 6

Help with a If value then paste, but searching through a range for the matching value

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Help with a If value then paste, but searching through a range for the matching value

    Right now I am using this to help me update my roster. I take an outside roster, I copy the team then go click a corresponding hyperlink in my workbook that kicks off the macro below. It'll work just fine but If "Natalie" and the others get shifted as they occasionally do, then I'm going to have to update all the ranges. Instead I would like to have only one code that searches through row 4 for the value, when found it then clears out that column's rows 6-30 and then pastes values.



    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Help with a If value then paste, but searching through a range for the matching value

    What if you want to use "Dave" instead of "Natalie"?
    In your code you paste values in L6, but the macro does not show what has been copied so that it can be pasted. Please clarify.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Help with a If value then paste, but searching through a range for the matching value

    Ah, sorry. I copy the roster from another worksheet for Dave. I'll then click the hyperlink for Dave and I would want the macro to then search the range for Dave. If it was Natalie, then I would select the hyperlink for Natalie that would trigger the macro that searches for Natalie.

    So it would kind of stay as my current macro but it couldn't have absolute references. It would be something like this...

    Please Login or Register  to view this content.
    Last edited by taylorsm; 10-02-2018 at 05:31 PM.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Help with a If value then paste, but searching through a range for the matching value

    Try:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Help with a If value then paste, but searching through a range for the matching value

    Thanks! I think that works. I had to change ClearContents to Value = "" because ClearContents wipes out my clipboard too.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Help with a If value then paste, but searching through a range for the matching value

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Error 13 when searching for string matching range values
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-07-2016, 11:39 AM
  2. [SOLVED] Searching for unknown text string in a range and then matching it to a reference table
    By the_nibs in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-10-2015, 07:26 AM
  3. SEARCH FOR LAST MATCHING OCCURENCE IN Wb2, PASTE RANGE OF CELLS BACK TO Wb1
    By excelnat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2014, 06:52 AM
  4. [SOLVED] Search for multiple matching cells and copy/paste range?
    By papercut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2014, 11:24 AM
  5. Replies: 3
    Last Post: 11-26-2013, 04:53 AM
  6. Replies: 1
    Last Post: 11-25-2013, 09:30 AM
  7. Copy/Paste range of cells to another worksheet based on matching criteria
    By maa50904 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2013, 12:07 AM

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