I have a workbook ("Access List") comprised of two worksheets ("Access
List" and "Info").

I've got a UserForm ("AddNewUser) setup to insert information provided
into the sheet "Access List".  This is working just fine.

I'm having issues populating the several ComboBoxes ("CMB_Area" and
"CMB_Role") within this user form.  I have several named ranges
("Area" and "Role) located on the Sheet "Info" that I would like to
use to populate the contents of these ComboBoxes.

Here is my code thus far:

Private Sub addUser_Click()
    Dim NetRow As Long
    'Make sure Access List is active
    Sheets("Access List").Activate

    'Determine the next empty row
    NextRow = Application.WorksheetFunction. _
        CountA(Range("A:A")) + 1

    'Transfer the first name
    Cells(NextRow, 1) = fName.Text

    'Transfer the last name
    Cells(NextRow, 2) = lName.Text

    'Transfer the 4+4
    Cells(NextRow, 3) = ouNetID.Text

    'Transfer the AD Number
    Cells(NextRow, 4) = adNum.Text

    'Transfer the Area
    If Area = "Service Desk" Then Cells(NextRow, 5) = "Service Desk"
    If Area = "Hardware" Then Cells(NextRow, 5) = "Service Desk"

    'Transfer the Role
    If Role = "Tech P/T" Then Cells(NextRow, 6) = "Tech P/T"
    If Role = "Tech F/T" Then Cells(NextRow, 6) = "Tech F/T"
    If Role = "Mentor" Then Cells(NextRow, 6) = "Mentor"
    If Role = "Lead" Then Cells(NextRow, 6) = "Lead"
    If Role = "Student" Then Cells(NextRow, 6) = "Student"
    If Role = "Admin" Then Cells(NextRow, 6) = "Admin"

    'Close the form
    Unload AddNewUser
End Sub

Private Sub Area_Change()
With Area
    Worksheets("Info").Area.RowSource = "Area"
End Sub

Suggestions or improvements?  I am relatively new to VBA programming,
so I apologize if I've left out some needed info.  Thanks in advance!

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts

Reply via email to