I recorded a macro then added "If Selection <> Range("A1") Then" to it. Here's the script:
this works as long as my selection is only one cell. But I need to select and delete a range (or two or three ranges) of cells. How can I adjust that "if" statement?
Thank you!
VBA Code:
Sub DeleteCellsShiftUp()
'
' DeleteCellsShiftUp Macro
'
'
If Selection <> Range("A1") Then Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub
this works as long as my selection is only one cell. But I need to select and delete a range (or two or three ranges) of cells. How can I adjust that "if" statement?
Thank you!