WERNER SLABBERT
Board Regular
- Joined
- Mar 3, 2009
- Messages
- 107
ok so here i am trying to teach myself some vba ... but its a hard route. i need help making a money counter/ record keeping thingy...
i have the userfom basically setup but i am stuck. it doesnt wanna do what i want it to. rather than give a long winded explanation. i will load the workbook. please please help me one of you excel gods....
Code:
Private Sub Userform_Initialize() Me.Company.List = Worksheets("Data").Range("B42:B400").Value
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub CommandButton2_Click()
Unload Me
UserForm1.Show
End Sub
Private Sub TextBox200_AfterUpdate()
DoUpdate200
End Sub
Private Sub TextBox100_AfterUpdate()
DoUpdate100
End Sub
Private Sub TextBox50_AfterUpdate()
DoUpdate50
End Sub
Private Sub TextBox20_AfterUpdate()
DoUpdate20
End Sub
Private Sub TextBox10_AfterUpdate()
DoUpdate10
End Sub
Private Sub TextBox5_AfterUpdate()
DoUpdate5
End Sub
Private Sub TextBox2_AfterUpdate()
DoUpdate2
End Sub
Private Sub TextBox1_AfterUpdate()
DoUpdate1
End Sub
Private Sub TextBox50c_AfterUpdate()
DoUpdate50c
End Sub
Private Sub TextBox20c_AfterUpdate()
DoUpdate20c
End Sub
Private Sub TextBox10c_AfterUpdate()
DoUpdate10c
End Sub
Private Sub TextBox5c_AfterUpdate()
DoUpdate5c
End Sub
Private Sub TextBoxSubTotal__AfterUpdate()
DoUpdateSubT
End Sub
Sub DoUpdate200()
If TextBox200.Value = "" Then TextBox200.Value = 0
TextBox212.Value = TextBox200.Value * 200
TextBox212.Value = Format(TextBox212.Value, "R ###,##")
End Sub
Sub DoUpdate100()
If TextBox100.Value = "" Then TextBox100.Value = 0
TextBox211.Value = TextBox100.Value * 100
TextBox211.Value = Format(TextBox211.Value, "R ###,##")
End Sub
Sub DoUpdate50()
If TextBox50.Value = "" Then TextBox50.Value = 0
TextBox210.Value = TextBox50.Value * 50
TextBox210.Value = Format(TextBox210.Value, "R ###,##")
End Sub
Sub DoUpdate20()
If TextBox20.Value = "" Then TextBox20.Value = 0
TextBox209.Value = TextBox20.Value * 20
TextBox209.Value = Format(TextBox209.Value, "R ###,##")
End Sub
Sub DoUpdate10()
If TextBox10.Value = "" Then TextBox10.Value = 0
TextBox208.Value = TextBox10.Value * 10
TextBox208.Value = Format(TextBox208.Value, "R ###,##")
End Sub
Sub DoUpdate5()
If TextBox5.Value = "" Then TextBox5.Value = 0
TextBox207.Value = TextBox5.Value * 5
TextBox207.Value = Format(TextBox207.Value, "R ###,##")
End Sub
Sub DoUpdate2()
If TextBox2.Value = "" Then TextBox2.Value = 0
TextBox206.Value = TextBox2.Value * 2
TextBox206.Value = Format(TextBox206.Value, "R ###,##")
End Sub
Sub DoUpdate1()
If TextBox1.Value = "" Then TextBox1.Value = 0
TextBox205.Value = TextBox1.Value * 1
TextBox205.Value = Format(TextBox205.Value, "R ###,##")
End Sub
Sub DoUpdate50c()
If TextBox50c.Value = "" Then TextBox50c.Value = 0
TextBox204.Value = TextBox50c.Value * 0.5
TextBox204.Value = Format(TextBox204.Value, "currency")
End Sub
Sub DoUpdate20c()
If TextBox20c.Value = "" Then TextBox20c.Value = 0
TextBox203.Value = TextBox20c.Value * 0.2
TextBox203.Value = Format(TextBox203.Value, "currency")
End Sub
Sub DoUpdate10c()
If TextBox10c.Value = "" Then TextBox10c.Value = 0
TextBox202.Value = TextBox10c.Value * 0.1
TextBox202.Value = Format(TextBox202.Value, "currency")
End Sub
Sub DoUpdate5c()
If TextBox5c.Value = "" Then TextBox5c.Value = 0
TextBox201.Value = TextBox5c.Value * 0.05
TextBox201.Value = Format(TextBox201.Value, "currency")
End Sub
Sub DoUpdateSubT()
TextBoxSubTotal.Value = Format(TextBoxSubTotal.Value, "currency")
For I = 201 To 212
Sum = Sum + Val(Me("Textbox" & I))
Next I
Me.TextBoxSubTotal = Sum & ",00"
End Sub
i can't upload the workbook or pictures ...