Sub Macro6()
Dim rngW As Range
Dim cell As Range
Set rngW = Range("W1", Range("W65536").End(xlUp))
For Each cell In rngW
If cell.Value = "Y" Then
Rows.Select
Range.Activate
Selection.Insert Shift:=xlDown
End Sub
我想在我W在整個Excel表中找到的W列中的每個「Y」上面添加一個空行。這將幫助我分離大塊數據。我不斷收到「編譯錯誤:參數不可選」。是什麼賦予了?VBA函數 - 參數不可選(分離文本塊)
你缺少了'結束If'和'接下來cell' –