level 3
我是一个初学者,自己写了一个宏
Sub 宏1()
If Sheet1.Cells(84, 3) = "转入" Then Sheet1.Cells(1, 1) = 1
ElseIf Sheet1.Cells(84, 3) = "存款" Then Sheet1.Cells(1, 1) = 1
Else: Sheet1.Cells(1, 1) = 1
End If
End Sub
运行这个宏时,总显示“编译错误,else没有if” 问题出在哪?谢谢
2023年09月27日 05点09分
1
level 1
if ... then ... (end if)
elseif ... then ... (end if)
上面if...then...一行写完的话相当于后面跟着end if,所以接下来的else前面没有if
2023年10月15日 15点10分
4