+ Reply to Thread
Results 1 to 14 of 14

Find and match cell text value on another sheet and paste row on correct row number

  1. #1
    Registered User
    Join Date
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Find and match cell text value on another sheet and paste row on correct row number

    Hi all,

    I'm looking to refine the macro below I have recorded to find the value on "Sheet6" in cell H3 (the name of the person) on the "Availability" sheet and paste it across from column B. However, being new to VBA in the main I am unsure how to do this. I recorded the macro using the basic "find" option but of course this only finds the name of the person I specified. Hopefully you can help.

    The info I want pasted from Sheet 6 is contained in cells B6:M6 and I want it pasted from columns B:M across the row on the Availability sheet where the corresponding name of the person is in column A. Hope this makes sense. I've attached the workbook so hopefully this will make sense.

    It's a work in progress I inherited from someone else, so eventually parts are going to be hidden, which is why the vba needs to be fired from a submit button rather than using vlookup etc.

    Please Login or Register  to view this content.
    Thank you,
    Smash.
    Attached Files Attached Files

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

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Are you saying that you want to search for more than one name? If so, where are the names located in "Sheet6"?
    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
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Hi Mumps, thanks for taking the time to reply.

    The names are all located in the data sheet, I just want it to search for the name in the drop-down in H3 on Sheet 6 and then paste them from B to M on the correspondng row of Availability where that name is in Column A.

    Does that make sense?

    Hope so.

    Smash

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

    Re: Find and match cell text value on another sheet and paste row on correct row number

    OK. Just to clarify ... You will always copy B6:M6 from your "Data" sheet to the "Availability" regardless of which name is chosen from the drop down list in H3. Is this correct?

  5. #5
    Registered User
    Join Date
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Hi Mumps.

    Yes the data is in those cells with the times in, B6:M6 on the front sheet, "Sheet 6" and I want it to copy and paste special to the corresponding row on "Availability" that matches the name in H3.

    Thank you for helping

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

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your "Data" sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make your selection in H3.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Thanks very much, Mumps - that does work fine, but is there any way it can work through the user pressing the submit button? I want them to be able to select their name, fill in the times and press submit.

    Apologies for the faffing about, but being for work I'm trying to follow what people are used to and then build on it with ideas of my own (and the use of some books on VBA I have bought).

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Find and match cell text value on another sheet and paste row on correct row number

    As you can see, if you use the macro I suggested, you would have to make sure that the hours are entered before the name is selected in H3. This has the advantage of not needing to click a button. However, if you prefer to use a submit button, then create the button on your data sheet and copy and paste the macro below into a regular code module not in the worksheet code module as the previous macro. Make sure you delete that macro from the worksheet code module or it will interfere with the new one. Assign the new macro to the "Submit" button.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Mumps you are great, thank you!

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Find and match cell text value on another sheet and paste row on correct row number

    My pleasure.

  11. #11
    Registered User
    Join Date
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Mumps, I have just one other question if you don't mind, is there a little tweak that can be done so it pastes special, values only? I tried the addition of
    Please Login or Register  to view this content.
    but it threw me an error.

    Thanks so much for your help.

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Try:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    09-11-2015
    Location
    England
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    13

    Re: Find and match cell text value on another sheet and paste row on correct row number

    Thank you Mumps - I almost had it at one point after looking it up in one of the books I just got but I know it's going to take me a while to get to grips with it.

    Really appreciate your help buddy

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Find and match cell text value on another sheet and paste row on correct row number

    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] Find the row number with a partial match to text in column A
    By zookeepertx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2014, 01:39 PM
  2. Replies: 1
    Last Post: 03-03-2014, 08:45 PM
  3. [SOLVED] find text match amount and paste from sheet1 to sheet2
    By visha_1984 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 12-12-2013, 04:08 AM
  4. [SOLVED] Find match, find related cell and return that number
    By HelpHelpHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2012, 06:46 AM
  5. Find text then paste to different sheet
    By jpthelpguy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2009, 02:52 PM
  6. Merging the correct number of cell rows to fit a string of wrapped text
    By iterature in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2007, 02:15 PM
  7. [SOLVED] Find text in another workbook and paste if found match - VBA
    By Pasmatos in forum Excel General
    Replies: 1
    Last Post: 11-10-2005, 09:10 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