+ Reply to Thread
Results 1 to 9 of 9

Copy certain hidden template depending on option selected from drop down list

  1. #1
    Registered User
    Join Date
    07-19-2014
    Location
    London, England
    MS-Off Ver
    MS Office Mac
    Posts
    5

    Copy certain hidden template depending on option selected from drop down list

    Hi,

    Hope you can help, I don't even know where to start/if this is possible.

    I've got a "Hole Location" sheet which contains a drop down list with different options in it, eg. window sample, trial pit and inspection and corresponding hidden worksheets for each option.

    What I'm trying to do is copy the hidden sheet which corresponds to the option selected in the drop down list and insert it as a visible sheet after the Hole Location sheet. The process then repeats for the next row.

    Hope you can help

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy certain hidden template depending on option selected from drop down list

    Sounds plausible

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-19-2014
    Location
    London, England
    MS-Off Ver
    MS Office Mac
    Posts
    5

    Re: Copy certain hidden template depending on option selected from drop down list

    Hi.

    Thanks for your reply, attached (hopefully) is a cut down version of the spreadsheet.

    The Trial Pit and Dynamic Sample spreadsheets will be hidden and the first tab will be "Locations". I've mocked up what I'm after as you mentioned, BH01 and BH02 are both set as Dynamic Sample so the Dynamic Sample template has been copied and renamed BH01 and BH02 for each. The same occurs for TP01 and TP02.

    Many Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy certain hidden template depending on option selected from drop down list

    ok just so i can clarify it

    your locations sheet
    you will fill in ID and select type
    and you want to "trigger" (will a command button do? as you want to fill in all the id's and have some certainty before creating numerous sheets i would presume)
    so it creates a worksheet after "locations" with the corresponding template for that type?

    ie if it is Trial pit you want to create sheet with ID as name and template from trial pit template?

    please let me know if it i am on the mark or even slightly off

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy certain hidden template depending on option selected from drop down list

    actually didn't take as long as i thought it would

    see attached file if it matches what you wanted
    i added delete sheets as well in case you need that...i needed it to test the macro

    please take notes of the comments in Green i put in...i think i put enough in there to make it understandable

    ps i used forms instead of Activex in case of Mac compatibility issues
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-19-2014
    Location
    London, England
    MS-Off Ver
    MS Office Mac
    Posts
    5

    Re: Copy certain hidden template depending on option selected from drop down list

    Hi,

    That's brilliant, thank you!! I've noticed a couple of things while using it, do you know If there is a way to add additional sheets? I.e. I have put in BH02 and BH04 and clicked create sheets, however I then need to add BH03. I've tried reclicking Create Sheets but get a run time message (I'm guessing because it's trying to reproduce sheets which already exist). I know it will also probably be a couple of lines, but when the templates are hidden, the new sheets are also hidden. How would I unhide the new sheets?

    Thanks again

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy certain hidden template depending on option selected from drop down list

    re: the reclicking sheets
    how do you want the error to be handled?

    if you reclick you want to wipe all existing and replace with new? or create a duplicated sheet with similar name?

    Re: hidden
    is it rows or columns?
    Please Login or Register  to view this content.
    this is for rows

  8. #8
    Registered User
    Join Date
    07-19-2014
    Location
    London, England
    MS-Off Ver
    MS Office Mac
    Posts
    5

    Re: Copy certain hidden template depending on option selected from drop down list

    Hi,

    Thanks again. I'm hoping to add the extra sheet (a copy of the template sheet ideally) and leave the prexisting ones alone as they will likely already be filled with data. I've managed to solve the hidden sheet issue by basing it around your code which is great thank you (just making the entire sheet visible).

  9. #9
    Registered User
    Join Date
    07-19-2014
    Location
    London, England
    MS-Off Ver
    MS Office Mac
    Posts
    5

    Re: Copy certain hidden template depending on option selected from drop down list

    Hi,

    Thanks again. I'm hoping to add the extra sheet (a copy of the template sheet ideally) and leave the prexisting ones alone as they will likely already be filled with data. I've managed to solve the hidden sheet issue by basing it around your code which is great thank you (just making the entire sheet visible).

+ 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. Replies: 3
    Last Post: 10-08-2014, 04:17 PM
  2. Copy row based on drop down list selected
    By joeycrak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2014, 05:27 PM
  3. HELP : Unhide sheet only the Selected option from drop down list
    By shiven.k in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-11-2013, 12:37 AM
  4. Looking up different data sets depending on option selected.
    By sjkeating304 in forum Excel General
    Replies: 5
    Last Post: 08-27-2012, 03:02 PM
  5. Replies: 1
    Last Post: 04-11-2005, 01:06 PM

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