+ Reply to Thread
Results 1 to 11 of 11

User form interaction with work sheet drop down

  1. #1
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    User form interaction with work sheet drop down

    Hi,

    I have built this fractional salary tool to calculate salaries. The tool works by having a pop up with 3 drop downs.

    First you choose the Scale
    Then the fraction
    Then the Scale point

    Basically on the spreadsheet by selecting the scale from the drop down in cell w15 it uses INDIRECT($X$15) in the validation for the drop down. cell x15 has a lookup and pulls the name of the range for that scale.

    This means that only the points that relate to that scale are available in the scale point drop down.

    So my problem is that, this works perfectly on the spreadsheet, but it doesn't work on the macro. The macro is accessed on the "MENU" tab.
    Attached Files Attached Files
    Last edited by mcinnes01; 10-14-2010 at 07:57 AM. Reason: new file version

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: User form interaction with work sheet drop down

    I know this is not the answer you are looking for, but why bother with a userform in the first place since it appears you can accomplish what you need using formulas in the worksheet?

    Why not move the validation drop downs to the Menu sheet and set this sheet up to mimic a form? It is much simpler and avoids needless use of VBA.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: User form interaction with work sheet drop down

    Hello mcinnes01,

    I moved your ComboBox1 event from the Change to the Click event. This seems to be working. Have a look and let me know.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: User form interaction with work sheet drop down

    It doesn't seem to change the points range when a different scale is selected.

    I've been trying to see if I can use rowsource

    E.g. (but doesn't work)

    Please Login or Register  to view this content.
    Last edited by mcinnes01; 10-14-2010 at 04:38 AM.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: User form interaction with work sheet drop down

    Hello mcinnes01,

    Maybe I am not clear on the problem. Can you give me a couple of examples showing the inputs, what you expect, and what you are getting?

  6. #6
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: User form interaction with work sheet drop down

    I thought this might work but apperently it doesn't. Can you give me some pointers as to where I am going wrong.

    I take it that when you use rowsource in your code you don't set a row source in the property box?

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: User form interaction with work sheet drop down

    Hello mcinnes01,

    Just set the RowSource equal to the name of the named range.

  8. #8
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: User form interaction with work sheet drop down

    my problem is, that the x15 which I have now named "dynamicRng" does a lookup based on w15 and returns the name of the range which I have set for each scale. These can be seen on the Scale data sheet.

    At the moment the validation works on the sheet by using INDIRECT(dynamicRng) or INDIRECT($X$15)

    But if I set the row source property to dynamicRng in the PointDrop combobox it return the name of the range relating to that scale.

    E.g. Scale 1 has a Range Name of sc1

    so in the point drop combo box, instead of listing 1,2,3,4,5,6,7,8,9,10 it just list sc1

  9. #9
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: User form interaction with work sheet drop down

    also if I set the row source property to INDIRECT(dynamicRng) it works for the scale that is in sheet before you open the macro but then doesn't update when you select a new scale.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,263

    Re: User form interaction with work sheet drop down

    Does this do what you want?
    Attached Files Attached Files
    Remember what the dormouse said
    Feed your head

  11. #11
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Talking Re: User form interaction with work sheet drop down

    Thats exactly what I was trying to do, thank you!

    I really need an VBA course by the looks of things, I seem to be a million miles of coming up with code like that myself.

    Thanks RS you rule!

+ 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