Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Private Sub CommandButton1_Click()
  2.  
  3. ActiveCell.Value = ComboBox1.Value
  4. ActiveCell.Offset(0, 1) = ComboBox2.Value
  5.  
  6. End Sub
  7.  
  8. Private Sub UserForm_Initialize()
  9.  
  10. If ActiveCell.Value = vbNullString Then
  11. With ComboBox1
  12. .AddItem "Meal"
  13. .AddItem "Educat"
  14. End With
  15. Else
  16. With ComboBox1
  17. .AddItem "Income"
  18. End With
  19. End If
  20.  
  21. If Me.ComboBox2.Value = "Income" Then
  22. With ComboBox2
  23. .AddItem "Grant"
  24. .AddItem "Parents"
  25. End With
  26. ElseIf Me.ComboBox2.Value = "Meal" Then
  27. With ComboBox2
  28. .AddItem "Food"
  29. .AddItem "Drink"
  30. End With
  31. Else
  32. With ComboBox2
  33. .AddItem "Books"
  34. .AddItem "Fees"
  35. End With
  36. End If
  37.  
  38. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement