+ Reply to Thread
Results 1 to 7 of 7

If specific cells contain specific values then reference cells from another sheet macro.

  1. #1
    Registered User
    Join Date
    11-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    25

    If specific cells contain specific values then reference cells from another sheet macro.

    Hi,

    New here and posting for the first time.

    I please need some help creating a macro that runs automatically when two different cells contain specifc values.

    I have cells A1 and A2 on (Sheet1) that each contain lists. For example, A1 list will contain Red, Green, Blue and A2 list will contain Fish, Eel, Frog. Any combination of these two cells, after selecting from the lists, will pertain to ranges of data on another sheet (Sheet2).

    After selecting from the two lists in A1 and A2 I would like a macro to automatically copy the Data on (Sheet2) that pertains to the combination of A1 and A2 on (Sheet1), and paste it into a range on (Sheet 1).

    I specifically need some help figuring out how to have a macro run automatically only after both of the cells A1 and A2 have had list items selected.

    Can someone please help me out with this? It would be much appreciated.

    If you need me to give more clarrification please let me know.

    Thanks.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If specific cells contain specific values then reference cells from another sheet macr

    Hi, and welcome to the forum.

    You may not need a macro since it can probably be achieved with functions. However we need to see your layout and some example results which you should add manually. At the moment I'm confused by your reference to 'lists' in A1 & A2. Lists usually occupy a range of many contiguous cells. Are you saying that in the single cell A1 you have "Red,Green,Blue" for instance?

    If you would upload a workbook example that should clear up the confusion.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: If specific cells contain specific values then reference cells from another sheet macr

    Hi Richard,

    Thanks for the quick response.

    Attached please find a workbook example that I hope will clear up the confusion.

    After selecting the options from the lists in B1 and B2 on Sheet1 I want a function or macro to automatically populate the (A5:A9) range and (B5:B9) range on Sheet1 with the data found in the charts on Sheet2 that corresponds to the selections made from the lists on Sheet1.
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If specific cells contain specific values then reference cells from another sheet macr

    Hi,

    Are the Gold bands in A20:A23 deliberately different to the bands for Bronze & Silver or is there a typo there?

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If specific cells contain specific values then reference cells from another sheet macr

    Assuming the Gold band is different then

    A5 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    B5 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: If specific cells contain specific values then reference cells from another sheet macr

    Yes they were deliberately made different. Works great and thanks so much for the help. I might be back with more questions.

  7. #7
    Registered User
    Join Date
    11-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: If specific cells contain specific values then reference cells from another sheet macr

    Hi Richard,

    The forumulas you provided work great, but I am having some trouble understanding what parts of them are doing. Would you be so kind to explain the formulas and the different parts and what they mean? I'd like to apply these formulas to other situations but I'm having a hard time since I don't completely understand how they work. The +2+ROW()-5 part stumps me the most.
    Last edited by dredre609; 05-14-2014 at 06:04 PM.

+ 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] Macro to copy specific data from one WB to specific cells in another WB based on specific
    By d_rose in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2014, 11:05 AM
  2. [SOLVED] Macro for copying rows with cells with specific values from 1 sheet to another
    By Rizla21 in forum Excel Programming / VBA / Macros
    Replies: 40
    Last Post: 12-19-2013, 11:14 AM
  3. [SOLVED] Macro to generate a random number between 2 specific values into specific cells.
    By Nerfmagnet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-10-2013, 11:45 AM
  4. HELP! Macro to Copy specific cells from one sheet to another based on specific criteria
    By atriscritti in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2012, 11:05 AM
  5. Macro to extract data from multiple workbooks, specific sheet, specific cells
    By crissandraauree in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2012, 03:54 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