|
我有这样一段vb代码,想把如下公式加入进去,请问如何操作!!叩谢了!公式如下:=IF(AM7>=10,MID(RIGHTB(AM7*100,4),1,1),IF(AM7>=1,"","")), 代码如下:Private Sub CommandButton1_Click()
Dim a As Long
Dim h As Long
h = [A65536].End(xlUp).Row
If h = 65536 Then
MsgBox "数据记录已满,请另选择存储位置!", vbExclamation, "保存失败"
Exit Sub
End If
Dim XXX
XXX = Array(" ", "月", "日", "车属单位", "车型", "牌照号码", "计费吨位", "标准", "凭证号码", " ", " ", " ", " ", " ", " ", " ", " ", "标准", "凭证号码", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "养路费金额", "货附费金额")
For i = 3 To 37
If Cells(6, i) = " " Then
MsgBox XXX(i) & "不能为空!", vbExclamation, "重要提示"
Exit Sub
End If
Next i
a = Val(Cells(8, 4).Value) '目前录入车台总数
For i = 3 To 37
If h < 15 Then
Cells(a + 15, i) = Cells(6, i).Value
ActiveSheet.Cells(a + 15, i).Activate
End If
Next i
Range("C6:F6,H6:I6,K6,V6").ClearContents '清除所填内容
End Sub |
|