我正在尝试复制非空白单元格文本并粘贴到其他工作表。它无法粘贴且列为空白。没有错误弹出
我的代码:
Sub mycode()
Dim rngFiltered As Range
On Error Resume Next
Set rngFiltered = Worksheets("sheet1").Range("K2:K25").Cells.SpecialCells(xlCellTypeConstants)
On Error GoTo 0
If Not rngFiltered Is Nothing Then
rngFiltered.Copy Sheets("sheet2").Range("K2")
End If
End Sub