我需要帮助解决这个问题:
如果A列中的任何单元格为空,则在D列和E列中删除同一行中的单元格但仅向上移动D列和E列中的单元格,A列将保持不变...
答案 0 :(得分:1)
Sub DeleteUP_D_and_E_IF_A_IsEmpty()
Dim LastRow As Long, x As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For x = 2 To LastRow
If Cells(x , 1) = "" Then Range(Cells(x, "D"), Cells(x, "E")).Delete Shift:=xlUp
Next
End Sub