+ Reply to Thread
Results 1 to 7 of 7

Find all words in column and based on other cells, paste into other sheet in certain range

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Find all words in column and based on other cells, paste into other sheet in certain range

    Final-Sample.xlsm

    Find attached sample sheet. I need a macro that looks for the words "Penalty", "Try", "Conversion", "Drop Goal" in Column B only and when found, if the cell two cells directly to the right equals what is in Cell C1 then copy the word that is found (either Penalty, Try, Conversion or Drop Goal) and paste it into 'Sheet3 After'. You'll see in 'Sheet3 After' that in YR2:ABS2 there are numbers from 1 to 80. It needs to paste the word in the last used row of a column in that range in the row that matches one cell directly to the left of where the initial word was found.

    So if "Try" is found in B50 and D50 = C1 then copy "Try". Then look at the number directly left of the word "Try". If it is say 12, then paste the word "Try" into 'Sheet3 After' cell ZC3. Then, find the next instance of one of the four words, until all words have been found in column B. If there are two instances of 12 for example, then it needs to paste in the last used row, so the next time it'd paste into ZC4 for example. Hope that all makes sense. The sample sheet should help.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Find all words in column and based on other cells, paste into other sheet in certain r

    I threw this together in a hurry, but it might work.
    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 01-23-2016 at 04:54 PM.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Find all words in column and based on other cells, paste into other sheet in certain r

    There are a couple of extra columns for additional information, delete the lines you don't want/

    Please Login or Register  to view this content.
    Last edited by davesexcel; 01-24-2016 at 08:50 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find all words in column and based on other cells, paste into other sheet in certain r

    Quote Originally Posted by JLGWhiz View Post
    I threw this together in a hurry, but it might work.
    Please Login or Register  to view this content.
    This works perfectly! However, if there is another list of numbers of 1 to 80 on row 2 before the YR2:ABS2 range, then how can I alter it so that it doesn't paste in the wrong range?

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Find all words in column and based on other cells, paste into other sheet in certain r

    Set fn = sh2.Range("2:2").Find(t, , xlValues, xlWhole)
    You would make this line range specific like

    Please Login or Register  to view this content.
    Regards, JLG

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Find all words in column and based on other cells, paste into other sheet in certain r

    ScabbyDog ,
    Try
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Find all words in column and based on other cells, paste into other sheet in certain r

    Awesome guys. Thanks so much. Great help.

+ 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] Copy and paste random cells values from a range to another sheet column with no blanks
    By macquhele in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2015, 06:05 PM
  2. trying to find cells with certain words and to reference them in another column.
    By speakerbruce in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2014, 10:34 AM
  3. [SOLVED] Copy and Paste Range of Cells based on # of cell values in Column A
    By bwaite87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2014, 05:51 PM
  4. Fill cells in one column based on specific words or letter from another column
    By dokkadokka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2013, 07:04 AM
  5. Find Page numbers on one sheet and paste on cells in a different sheet
    By sn79 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2013, 04:27 PM
  6. Replies: 2
    Last Post: 07-13-2012, 04:02 AM
  7. VBA macro to Find a dynamic range of cells, copy then paste to another sheet
    By Bmxerdude2087 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2012, 02:36 PM

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