+ Reply to Thread
Results 1 to 9 of 9

VBA to match cell value then move range to sheet name that matches

  1. #1
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    VBA to match cell value then move range to sheet name that matches

    Good Day,

    I've got a report that goes out with five sheets within the workbook. To start we export a pre-packaged report from our system (Sheet 1). We then create 5 additional sheets each with their own unique name. We then look at the cell value in Column F and if it matches one of the sheet names then we cut&paste that entire row into the next available row within that sheet. Once all of the rows from Sheet 1 have been distributed to one of the other five sheets we delete Sheet 1 so you're just left with the five sheets.

    is that clear? I hope so!

    I need a piece of VBA to add into the rest of my Macro to do this if I can.

    thanks for your help

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

    Re: VBA to match cell value then move range to sheet name that matches

    I assume the column F you refer to is in Sheet1. Is that correct? Will there ever be any values in column F that do not have a corresponding sheet with the same name?
    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
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA to match cell value then move range to sheet name that matches

    Yes: Column F is in Sheet 1. Yes: there are times where the value is not found in any of the sheets. In that case I'd like to leave the Sheet 1. (I don't need the Macro to delete Sheet 1 at all, I can do that manually)

    THANKS!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: VBA to match cell value then move range to sheet name that matches

    How about
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA to match cell value then move range to sheet name that matches

    Doesn't do anything after executing.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: VBA to match cell value then move range to sheet name that matches

    Did you get any error messages?
    Also what are your sheet names & is the data in col F an exact match to the sheet names?

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

    Re: VBA to match cell value then move range to sheet name that matches

    Copy/paste the following into a regular module and run from there:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA to match cell value then move range to sheet name that matches

    Looks like it works great!! thanks!

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

    Re: VBA to match cell value then move range to sheet name that matches

    Glad it worked out.

+ 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. Replies: 2
    Last Post: 09-13-2017, 10:06 AM
  2. [SOLVED] selecting a sheet that matches the name in a cell range
    By Muckybox in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-25-2017, 05:17 PM
  3. Duplicate matches in seperate columns, move entire row to new sheet
    By katymc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2016, 09:33 AM
  4. Replies: 0
    Last Post: 04-07-2015, 09:05 PM
  5. Need to move data that matches criteria in cell and move to new worksheet
    By panagle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2013, 09:23 AM
  6. [SOLVED] Code needed to move cell value from one sheet to another if match is found.
    By SLIDE1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 07:46 PM
  7. Help! Need to move rows to separate worksheet if cell values match a value in range
    By nzamparo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-25-2011, 12:20 AM

Tags for this Thread

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