Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Showing a userform in excel 2010 without knowing the name at runtime.

  1. #11


    Register for a FREE account, and/
    or Log in to avoid these ads!

    SheetZ will be where the names that will be in the combobox are stored when they are added. The 3 Data items in the listbox are just fillers for right now, the listbox will hold the names of the personnel assigned to the supervisor in the combobox. Sorry for the confusion with all of this.

  2. #12
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    829
    Articles
    0
    Excel Version
    Excel 2010
    tnkcoll

    Sorry buds, would like to assist but just don't understand what you're trying to do.
    Looks like create a bunch of userforms all the same except for the caption.
    And what you plan to do or have on those forms, I have no idea.

    I'm not able to create the userform via module procedure but made an approximation for display.
    And put some 'stuff' on your Z-sheet for something to play with.

    If this helps at all that's good. If not I'm sure you know where the Delete key is.

    Good luck with your project
    NoS
    Attached Files Attached Files

  3. #13
    Thank you NoS, your example gave me a new direction to go. It doesn't look like I will need all those extra userforms now. If I have anymore problems I will post them here. Thank you again.

  4. #14
    I ran into another problem,
    I am trying to assign a trainee to a supervisor in userform1. I enter the trainee's name in a textbox called "txtTraineesName" then hit the "ADD" button and want the trainee's name to go into the first empty row of column B and their supervisor's name to go into the same row in column C. The supervisor's name is the caption of userform1. I tried researching this and came up with nothing, maybe I'm looking in the wrong places. I thought vlookup would be a good route to go since all the supervisor's names will be in column A, but I will be sorting this row as new supervisors are added, so they will not always be in the same cell. Thank you in advance for all your help.

  5. #15
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    829
    Articles
    0
    Excel Version
    Excel 2010
    Ron de Bruin has a very useful web site for VBA things. Check out http://www.rondebruin.nl/last.htm to see about finding last used row and column.

    'get the last row used in column B
    Last_row_used_in_B = Cells(ActiveSheet.Rows.Count, "B").End(xlUp).Row

    'the next available row where you will add your info
    RowToUse = Cells(ActiveSheet.Rows.Count, "B").End(xlUp).Row + 1

    Cell for added trainee: Cells(RowToUse,2).value = txtTraineesName.text
    Cell for supervisor: Cells(RowToUse,3).value = Userform1.Caption

    tnkcoll you'll have to play around with this regarding the userform being loaded and the correct worksheet active.
    Hope this is of some assistance.
    NoS

  6. #16
    Thanks NoS. I have another problem I need assistance with. I know I'm wasting a lot of your time and I feel bad about it. I've searched for answers elsewhere and can't come up with any. If you have some more websites you can direct me too for learning VBA so I don't waste anymore of your time I would apreciate it. My problem now is a bit complex(for me), I have it where everytime a new supervisor is added, it creates a new worksheet for that supervisor and then the ADD button on userform1 will add trainees to that supervisor's worksheet. That part works great, but here's the problem, everytime I assign a trainee to a supervisor I need cells D-K from Sheets("Z") to be copied to the supervisor's worksheet starting with the next empty column. I looked through the website you talked about in your last post and I couldn't figure out this problem. Thank you for all the help you've given me, sorry for being such a burden to you.
    Attached Files Attached Files
    Last edited by tnkcoll; 2013-02-11 at 06:17 PM.

  7. #17
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    829
    Articles
    0
    Excel Version
    Excel 2010
    Here is a message I came across in another forum that could have you looking at VBA stuff from now 'til the end of time.

    http://www.mrexcel.com/forum/general...ml#post3381628

  8. #18
    Thanks Nos, I found my answer. You are awesome. I can't thank you enough for all the help you've given me. I will post my project here when it is complete in case others have the same issues I did. Thanks again.
    Last edited by tnkcoll; 2013-02-12 at 08:02 AM.

  9. #19
    NoS, I have one last problem that I can't solve, I've looked through the links you gave me but got nowhere with this particular subject. I learned a lot from them though. I have created a list of dropdown menus in sheets(Z) that are copied to the supervisor's sheet when a new trainee is added. I need to somehow link these dropdown menus with the corresponding trainee's name in the same sheet. Then, when the trainee's name is selected from the combobox on userform1, the item numbers to the left of the dropdown menus in the supervisors sheet will be written to the listbox on userform1. This should be the last time I bother you, everything else I have learned how to do on my own. Thank you for everything.
    Attached Files Attached Files

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •