Dim VatRate As Single
Private Sub Vat()
If opt0 Then
VatRate = 0
ElseIf opt5 Then
VatRate = 0.05
ElseIf opt18 Then
VatRate = 0.18
End If
End Sub
Private Sub SaveRow()
Cells(Cr, 1).Value = txtInvDate.Text
Cells(Cr, 2).Value = txtInvNum.Text
Cells(Cr, 3).Value = txtInvSup.Text
Cells(Cr, 4).Value = txtInvGoods.Text
Cells(Cr, 5).Value = txtInvVal.Text
If opt0 = True Then
Cells(Cr, 6).Value = VatRate
Cells(Cr, 6).Value = VatRate * Cells(Cr, 5).Value
Cells(Cr, 9).Value = Cells(Cr, 5).Value + Cells(Cr, 6).Value
ElseIf opt5 = True Then
Cells(Cr, 7).Value = VatRate
Cells(Cr, 7).Value = VatRate * Cells(Cr, 5).Value
Cells(Cr, 9).Value = Cells(Cr, 5).Value + Cells(Cr, 7).Value
ElseIf opt18 = True Then
Cells(Cr, 8).Value = VatRate
Cells(Cr, 8).Value = VatRate * Cells(Cr, 5).Value
Cells(Cr, 9).Value = Cells(Cr, 5).Value + Cells(Cr, 8).Value
End If
End Sub
opt0, opt5 and opt18 are 3 option buttons
no matter which one I check the value goes in as 0
Bookmarks