Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Agriculture
  2. Art and photography
  3. Arts and theatre
  4. Charity and non-profit
  5. Corporate
  6. Educational and academic
  7.  
  8. ag
  9. ap
  10. at
  11. cn
  12. co
  13. ea
  14.  
  15. 'Populate Industry combo box.
  16. Dim range_c As Range
  17. Dim ws_c As Worksheet
  18. Set ws_c = Worksheets("4.1 List data")
  19.  
  20. For Each range_c In ws_c.Range("IndustryList")
  21. With Me.Industry
  22. .AddItem range_c.Value
  23. .List(.ListCount - 1, 1) = range_c.Offset(0, 1).Value
  24. End With
  25. Next range_c
  26.  
  27. IndustrySpecifier.Value = ""
  28.  
  29. Private Sub UserForm_Initialize()
  30. Dim range_c As Range
  31.  
  32. For Each range_c In Worksheets("4.1 List data").Range("IndustryList")
  33. With Me.Industry
  34. .AddItem range_c.Value
  35. .List(.ListCount - 1, 1) = range_c.Offset(0, 1).Value
  36. End With
  37. Next range_c
  38. End Sub
  39.  
  40. Private Sub Industry_Change()
  41. With Me.Industry
  42. If .ListIndex = -1 Then
  43. IndustrySpecifier.Text = ""
  44. Else
  45. IndustrySpecifier.Text = .List(.ListIndex, 1)
  46. End If
  47. End With
  48. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement