+ Reply to Thread
Results 1 to 5 of 5

copying from one sheet to another

  1. #1
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    copying from one sheet to another

    My main sheet has a couple drop down menus controlled by vba which depending on what is selected, it assigns cells differently. For example, from the drop down menu, if 'A' is selected, cell G16 will be assigned as "abc", but if 'B' is selected from the drop down menu, cell G16 will be assigned as "xyz".

    Just for additional information as it may help, "abc" and "xyz" are actually assigned around G90 and G91, but when 'A' or 'B' are selected, it cuts "abc" and "xyz" for G90 or G91 and pastes them to G16.

    What I am trying to do is have cells in another worksheet show what is in the first screen. But if I assign cell G16 in Sheet2 as 'Sheet1'!G16, it will work if 'A' is selected from the drop down menu, but return #REF! when 'B' is selected from the drop down menu.

    Does anyone know how I can do this using vba (not preferred) or otherwise.

    Thanks.
    Last edited by gss; 04-02-2009 at 10:38 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: copying from one sheet to another

    How about something in your cell that does the job with a simple IF() test:

    =IF(A2="a",$G$90,IF(A2="b",$G$91,""))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: copying from one sheet to another

    Quote Originally Posted by JBeaucaire View Post
    How about something in your cell that does the job with a simple IF() test:

    =IF(A2="a",$G$90,IF(A2="b",$G$91,""))
    That's the way I was planning on going if I couldn't figure out an easier way. The only problem is I have a LOT of different options from several different drop down menus, and I have values in a LOT of cells. This way will take a really long time.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: copying from one sheet to another

    Then you need to step back from your sheet and do some reorganization. Scattering reference values all over the place is non-intuitive and confusing to anyone other than the person who built the sheet.

    If you have a LOT of "comparison" values, then you should chart them and reference the chart. Something like this on your sheet off to the right somewhere:
    Please Login or Register  to view this content.
    Then, instead of the "IF" approach shown earlier, you use a simple INDEX/MATCH formula against the chart.

    =INDEX($K$1:$K$10,MATCH(A2,$J$1:$J$10,0))

    That chart can scale up to any size you want. As long as the appropriate "response" data is in the matching row, you can use this.

  5. #5
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: copying from one sheet to another

    I agree with you. This spreadsheet was made by someone who used to work for the company. He's gone so I was left in charge of modifying it and it took me forever to get a hang of everything that's going on.

    Anyways, the chart thing worked.

    Thanks for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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