Results 1 to 6 of 6

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

Threaded View

  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.



    Sub PasteNatalieRoster()
        If Range("L4").Value = "Natalie" Then
        Range("L6:L30").Value = ""
        Range("L6").PasteSpecial xlPasteValues
        Else: MsgBox ("Error: Has Natalie Moved?")
        End If
    End Sub
    Attached Files Attached Files

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