+ Reply to Thread
Results 1 to 10 of 10

Opening up profiles upon clicking on the personnel's name

  1. #1
    Registered User
    Join Date
    09-02-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Opening up profiles upon clicking on the personnel's name

    I have this data sheet with 7 personnels name in it. What I require is that upon clicking on the name of the person, the profiles that are attached to this person will open up.

    Before any name is clicked, these sheets should not be visible to the user and upon clicking on the other names, the sheets that was previously open will disappear.
    Last edited by gloom52; 10-04-2009 at 03:59 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Opening up profiles upon clicking on the personnel's name

    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.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.


    Basically - post a file that replicates your setup in terms of the no. of sheets in the file - where the code is to be run from etc etc... you will need to use VBA.

  3. #3
    Registered User
    Join Date
    09-02-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Opening up profiles upon clicking on the personnel's name

    heres the example. When the name in blue (assuming that name changes colour when clicked) the rest of the sheets except those displayed will be hidden or not visible
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Opening up profiles upon clicking on the personnel's name

    I can see one immediate issue... the sheet naming convention...

    ie for:

    Mohd Sufian Bin Mahmood

    the sheets for the above are prefixed with Suffian, correct ?

    So how would you deduce the prefix for say:

    Tan Suan Theng

    would they be Suan, Theng etc...

    (searching for "any" of the ee name in the sheet names is inherently risky IMO)

    If you were to say store the sheet name prefix say above the M/S flag you could use that - if you don't have that I think things will get quite messy.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Opening up profiles upon clicking on the personnel's name

    Based on the above post and your file...

    First I inserted two sheets - one called START and one called END - the START sheet was placed before the first of all the sheets to be hidden/made visible (ie after Dec09) ... END was placed after the last sheet to be hidden.

    Second I inserted the appropriate sheet prefix in the cell above marital status, eg H5 is Sufian, D19 is Khameed etc...

    Lastly, I inserted the below by right clicking on Team Data tab - selecting View Code and pasting below into resulting window. You must ensure Macros are enabled thereafter.

    Please Login or Register  to view this content.
    When you double click on a name in either Column A or D the appropriate sheets should display... the remainder are "very hidden" meaning they are not visible via the Sheets Unhide/Hide menu (can only be made visible by VBA) - if you don't need this you can revised xlVeryHidden to xlHidden.

  6. #6
    Registered User
    Join Date
    09-02-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Opening up profiles upon clicking on the personnel's name

    erm the naming of the sheets could be anything as long as the month is reflected so I could just change that to
    eg. Tan Suan Theng = TST
    eg. Mohd Sufian bin Mahmood= MSM

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Opening up profiles upon clicking on the personnel's name

    To avoid confusion I have for your benefit put my prior post into your file... I would however still suggest trying to replicate the steps yourself for sake of familiarity.

    As you can see in the attached there is no prefix assigned to D5 on Team Data... double clicking on a name for which no prefix is assigned will by the nature of the code unhide all sheets. If you double click on any name with a sheet prefix assigned you should see the visible sheets alter accordingly.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-02-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Opening up profiles upon clicking on the personnel's name

    From your post here I managed to get the script to work on my own workbook but I totally do not have any knowledge on these scripts. Maybe you can enlighten me a little on scripting?

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Opening up profiles upon clicking on the personnel's name

    Advice on scripting ?

    Well it's a programming language (based on VB6) so it's not something that can be learnt overnight or explained away in a few lines I'm afraid... like most VBA-ers I'm self taught and I've learnt by reading posts, using the Macro Recorder and a lot (lot) of trial and error.

    For a general synopsis of VBA: http://en.wikipedia.org/wiki/Visual_...r_Applications

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Opening up profiles upon clicking on the personnel's name

    Just as a side note, gloom, VBScript and VBA are not the same language. See http://en.wikipedia.org/wiki/Vbscript.
    Entia non sunt multiplicanda sine necessitate

+ 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