+ Reply to Thread
Results 1 to 6 of 6

HELP! making a table show up by choice. Writing VBA

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    5

    HELP! making a table show up by choice. Writing VBA

    Hello all

    I have a form (workbook) that i would like to have a specific set of cells (say on Sheet2) pop up on Sheet1 when a source is selected from a drop down menu. And then again when a different source from that drop down menu is selected, a different table say from Sheet3 will apear on Sheet1.

    So i am learning i can use the VBA function to write a code. Anyone here can set up something for me to base mine off of or give me instructions on making one? Thanks

    O and I will have multiple selections from teh drop down choices that would populate the same specific set of cells. (ex. choices "XVG1.5" and "XVG2.0" from the drop down would both pull the same set of cells from say Sheet2 into Sheet1.)

    If I am not clear on anything please let me know.

    Thanks again

    -Alex

  2. #2
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: HELP! making a table show up by choice. Writing VBA

    I would setup a cell on sheet 1 with Data Validation(list) with all the selections needed. Then I would use the Worksheet_Change event to trigger the macro code to do the following;

    1. Clear space on sheet 1.
    2. Copy stuff from sheet whatever to sheet 1.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: HELP! making a table show up by choice. Writing VBA

    Sounds to melike a PivotTable or AutoFilter would be a better option
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    03-16-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: HELP! making a table show up by choice. Writing VBA

    Yes I was just reading about a pivot table but am confused on how to enter the coding.

    But i do have a drop down choice (data validation) for the choices (i.e. XVG1.5, XVG2.0 etc.)

    Anyone can set me up with a good website or instructions to follow or make a guide for me to work off of?

    Thanks again
    -Alex

  5. #5
    Registered User
    Join Date
    03-16-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: HELP! making a table show up by choice. Writing VBA

    Another item

    Basically I want something along these lines.(I know this is not excel gramically corect)

    B13 =Sheet2!(A1:J20) if G5=XVG1.5 or XVG2.0

    thwn also

    B13 =Sheet3!(A1:L20) if G5=HFG or ACT

    maybe that helps what im looing for.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: HELP! making a table show up by choice. Writing VBA

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.


    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.


    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.


    To upload a file from your computer, click the 'Browse' button and locate the file.


    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.


    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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