【发布时间】:2023-03-08 07:41:01
【问题描述】:
我正在尝试使用“_”将来自用户输入表单的信息链接在一起,并有条件地从第二个变量中减去一个。这是我所拥有的:
If strckbx = True & strmonth = "oct" Then
Range("C1") = strmonth + "_" + (strfiscalyear - 1)
Else
Range("C1") = strmonth + ("_") + strfiscalyear
End If
If strckbx = True & strmonth = "Nov" Then
Range("C1") = strmonth + ("_") + (strfiscalyear- 1)
Else
Range("C1") = strmonth + ("_") + strfiscalyear
End If
If strckbx = True & strmonth = "dec" Then
Range("C1") = strmonth + ("_") + (strfiscalyear - 1)
Else
Range("C1") = strmonth + ("_") + strfiscalyear
End If
减一取决于用户表单中的复选框。当我尝试运行或测试它时,我不断收到运行时错误 13:类型不匹配。有谁知道我能做什么?
【问题讨论】: