Guest User

Untitled

a guest
Feb 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Private Sub UserForm_Initialize()
  2. Dim cell As Range
  3.  
  4. 'Populate NIGO dropdown menu from "DropDownMenus worksheet.
  5. For Each cell In .Range("B2:B" & .Cells(Rows.Count, 2).End(xlUp).Row)
  6. If Not IsEmpty(cell) Then NIGOcombobox.AddItem cell.Value
  7. Next cell
  8. End With
  9.  
  10. Private Sub NIGOcombobox_Change()
  11.  
  12. With Worksheets("DropDownMenus")
  13. .Activate
  14. Select Case NIGOcombobox
  15. 'Populate NIGO Reason list by dropdown menu selection.
  16. Case "AMRF"
  17. For Each cell In .Range("C3:C" & .Cells(Rows.Count, 3).End(xlUp).Row)
  18. If Not IsEmpty(cell) Then ListBox1.AddItem cell.Value
  19. Next cell
  20.  
  21. Case "OATS"
  22. For Each cell In .Range("D3:C" & .Cells(Rows.Count, 3).End(xlUp).Row)
  23. If Not IsEmpty(cell) Then ListBox1.AddItem cell.Value
  24. Next cell
  25.  
  26. Case Else
  27. MsgBox "Please select a NIGO Reason"
  28.  
  29. End Select
  30. End With
  31. End Sub
Add Comment
Please, Sign In to add comment