【发布时间】:2015-02-05 17:04:20
【问题描述】:
我正在尝试运行一个脚本,根据某列的单元格值在现有行之间插入空白行。
到目前为止,我有这个:
Set currentcell = Sheets("L1f").Range("I2:I131")
Do While Not IsEmpty(currentcell)
Set nextcell = ActiveCell.Offset(1, 0)
** If currentcell.Value = 1 Then
nextcell.EntireRow.Insert
ElseIf currentcell.Value = 2 Then
nextcell.EntireRow.Insert
nextcell.EntireRow.Insert
ElseIf currentcell.Value = 3 Then
nextcell.EntireRow.Insert
nextcell.EntireRow.Insert
nextcell.EntireRow.Insert
End If
Set currentcell = nextcell
Loop
我在突出显示的行上遇到运行时错误 13 类型不匹配。我已经搜索了这个网站,但没有找到解决办法,但我是新手,所以任何帮助/指导都会非常感谢!
【问题讨论】:
标签: excel runtime-error type-mismatch vba