You are on page 1of 1

oding:

Add Button
TextBox3.Value = Val(TextBox1.Value) + Val(TextBox2.Value)
TextBox5.Value = Val(TextBox3.Value) - Val(TextBox4.Value)

Subtract Button
TextBox3.Value = Val(TextBox1.Value) - Val(TextBox2.Value)
TextBox5.Value = Val(TextBox3.Value) - Val(TextBox4.Value)

Multiply Button
TextBox3.Value = Val(TextBox1.Value) * Val(TextBox2.Value)
TextBox5.Value = Val(TextBox3.Value) - Val(TextBox4.Value)

Divide Button
TextBox3.Value = Val(TextBox1.Value) / Val(TextBox2.Value)
TextBox5.Value = Val(TextBox3.Value) - Val(TextBox4.Value)

Percentage Button
TextBox6.Value = Val(TextBox3.Value) * Val(TextBox4.Value) / 100
TextBox5.Value = Val(TextBox3.Value) - Val(TextBox6.Value)

Calculate Button (Add only if you do not want to do same coding in percentage
button textbox5 code, otherwise use it there straight way).
TextBox5.Value = Val(TextBox3.Value) - Val(TextBox6.Value)

x = Sheet2.Range("B" & Rows.Count).End(xlUp).Row + 1


Sheet2.Cells(x, 2).Value = TextBox1.Value
Sheet2.Cells(x, 3).Value = TextBox2.Value
Sheet2.Cells(x, 4).Value = TextBox3.Value
Sheet2.Cells(x, 5).Value = TextBox4.Value
Sheet2.Cells(x, 6).Value = TextBox5.Value
Sheet2.Cells(x, 7).Value = TextBox6.Value
Sheet2.Cells(x, 8).Value = ComboBox1.Value
End Sub

Private Sub UserForm_Click()


TextBox1 = Application.WorksheetFunction.CountA(Sheet2.Range("B7:B10000")) + 1

Reset Button
Unload Me
Cal_form.Show

Close Button
Unload Me

You might also like