大大不好意思..在請教一下
Private Sub CommandButton3_Click()
Dim t As Integer, v1 As Integer
For t = 1 To 17
Range("C" & t + 3).Value = FormatNumber(Round(Range("A" & t + 3).Value * 3.3, 1))
Range("D" & t + 3).Value = FormatNumber(Round(Range("B" & t + 3).Value * 3.3, 1))
If Range("D" & t + 3) <> 0 Then
Range("E" & t + 3) = FormatNumber(Round(Range("C" & t + 3) / Range("D" & t + 3), 2))
Else
Range("E" & t + 3).Value = ""
End If
'================================================================================
'20年以下
If Range("A" & t + 3) = "" Then
Range(("C" & t + 3), ("E" & t + 3)) = ""
Exit Sub
End If
If (Range("E" & t + 3) > 3) Then
Range("F" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.4) - (Range("D" & t + 3) * 0.7), 0))
ElseIf (Range("E" & t + 3) > 2) Then
Range("F" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.3) - (Range("D" & t + 3) * 0.4), 0))
ElseIf (Range("E" & t + 3) > 1) Then
Range("F" & t + 3) = FormatNumber(Round((Range("C" & t + 3) - Range("D" & t + 3)) * 0.2, 0))
ElseIf (Range("E" & t + 3) <= 1) Then
Range("F" & t + 3) = 0
End If
'================================================================================
'逾20~30年
If Range("A" & t + 3) = "" Then
Range(("C" & t + 3), ("E" & t + 3)) = ""
Exit Sub
End If
If (Range("E" & t + 3) > 3) Then
Range("G" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.36) - (Range("D" & t + 3) * 0.6), 0))
ElseIf (Range("E" & t + 3) > 2) Then
Range("G" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.28) - (Range("D" & t + 3) * 0.36), 0))
ElseIf (Range("E" & t + 3) > 1) Then
Range("G" & t + 3) = FormatNumber(Round((Range("C" & t + 3) - Range("D" & t + 3)) * 0.2, 0))
ElseIf (Range("E" & t + 3) <= 1) Then
Range("G" & t + 3) = 0
End If
'================================================================================
'逾30~40年
If Range("A" & t + 3) = "" Then
Range(("C" & t + 3), ("E" & t + 3)) = ""
Exit Sub
End If
If (Range("E" & t + 3) > 3) Then
Range("H" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.34) - (Range("D" & t + 3) * 0.55), 0))
ElseIf (Range("E" & t + 3) > 2) Then
Range("H" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.27) - (Range("D" & t + 3) * 0.34), 0))
ElseIf (Range("E" & t + 3) > 1) Then
Range("H" & t + 3) = FormatNumber(Round((Range("C" & t + 3) - Range("D" & t + 3)) * 0.2, 0))
ElseIf (Range("E" & t + 3) <= 1) Then
Range("H" & t + 3) = 0
End If
'================================================================================
'逾40年以上
If Range("A" & t + 3) = "" Then
Range(("C" & t + 3), ("E" & t + 3)) = ""
Exit Sub
End If
If (Range("E" & t + 3) > 3) Then
Range("I" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.32) - (Range("D" & t + 3) * 0.5), 0))
ElseIf (Range("E" & t + 3) > 2) Then
Range("I" & t + 3) = FormatNumber(Round((Range("C" & t + 3) * 0.26) - (Range("D" & t + 3) * 0.32), 0))
ElseIf (Range("E" & t + 3) > 1) Then
Range("I" & t + 3) = FormatNumber(Round((Range("C" & t + 3) - Range("D" & t + 3)) * 0.2, 0))
ElseIf (Range("E" & t + 3) <= 1) Then
Range("I" & t + 3) = 0
End If
'================================================================================
'增值稅總計
If Range("J" & t + 3) = "" Then
Range(("K" & t + 3)) = ""
Else
Range("K" & t + 3) = FormatNumber(Round((Range("F" & t + 3)) * (Range("J" & t + 3)), 1))
Range("L" & t + 3) = FormatNumber(Round((Range("G" & t + 3)) * (Range("J" & t + 3)), 1))
Range("M" & t + 3) = FormatNumber(Round((Range("H" & t + 3)) * (Range("J" & t + 3)), 1))
Range("N" & t + 3) = FormatNumber(Round((Range("I" & t + 3)) * (Range("J" & t + 3)), 1))
End If
Next
End Sub
為何在
A4儲存格輸入181,000
B4儲存格輸入140,625
--------------------
C4儲存格答案為597,300
D4儲存格答案為464,062(正確為464,063)
F4儲存格答案為26,648(正確為26,647)
不知要如何處置,有高手協助嗎???作者: sillykin 時間: 2015-9-4 17:29
Private Sub OptionButton1_Click()
If OptionButton1 = True Then
[B58].VALUE = 1
[C58] = "國防事業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton2_Click()
If OptionButton2 = True Then
[B58].Value = 2
[C58] = "警察單位"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton3_Click()
If OptionButton3 = True Then
[B58].Value = 3
[C58] = "其他公共行政類"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton4_Click()
If OptionButton4 = True Then
[B58].Value = 4
[C58] = "教育類"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton5_Click()
If OptionButton5 = True Then
[B58].Value = 5
[C58] = "學生"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton6_Click()
If OptionButton6 = True Then
[B58].Value = 6
[C58] = "工、商及服務類"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton7_Click()
If OptionButton7 = True Then
[B58].Value = 7
[C58] = "農林漁牧類"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton8_Click()
If OptionButton8 = True Then
[B58].Value = 8
[C58] = "礦石及土石採取業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton9_Click()
If OptionButton9 = True Then
[B58].Value = 9
[C58] = "製造業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton10_Click()
If OptionButton10 = True Then
[B58].Value = 10
[C58] = "水電燃氣業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton11_Click()
If OptionButton11 = True Then
[B58].Value = 11
[C58] = "營造業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton12_Click()
If OptionButton12 = True Then
[B58].Value = 12
[C58] = "批發及零售業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton13_Click()
If OptionButton13 = True Then
[B58].Value = 13
[C58] = "住宿及餐飲業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton14_Click()
If OptionButton14 = True Then
[B58].Value = 14
[C58] = "運輸、倉儲及通信業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton15_Click()
If OptionButton15 = True Then
[B58].Value = 15
[C58] = "金融及保險業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton16_Click()
If OptionButton16 = True Then
[B58].Value = 16
[C58] = "不動產及租賃業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton17_Click()
If OptionButton17 = True Then
[B58].Value = 17
[C58] = "專業服務業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton18_Click()
If OptionButton18 = True Then
[B58].Value = 18
[C58] = "技術服務業"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton19_Click()
If OptionButton19 = True Then
[B58].Value = 19
[C58] = "無業、家管、退休人員等"
End If
Unload Me
UserForm40.Show
End Sub
Private Sub OptionButton20_Click()
If OptionButton20 = True Then
[B58].Value = 20
[C58] = "不動非法人組織授信戶負責人"
End If
Unload Me
UserForm40.Show
End Sub
'===============================================================================