Hi
I require a VBA code to delete the following cell ranges
D3:N9
D13:N19
D23:N29
D33:N39
D43:N49
D53:N59
D63:N69
all the way down to
D273:N279
Sheet name is Score
Thanks
Rich
Printable View
Hi
I require a VBA code to delete the following cell ranges
D3:N9
D13:N19
D23:N29
D33:N39
D43:N49
D53:N59
D63:N69
all the way down to
D273:N279
Sheet name is Score
Thanks
Rich
Code:Sub DeleteRanges()
With Sheets("Score")
For i = 3 To 273 Step 10
.Range("D" & i).Resize(7, 11).ClearContents
Next
End With
End Sub
thanks
Can you add a message box before deleting which says "are you sure you want to delete data"
Thanks
Rich
This really wasn't so hard, not ?
Code:Sub DeleteRanges()
If MsgBox("Are you sure you want to delete data ?", vbYesNoCancel + vbExclamation, "Delete data") = vbYes Then
With Sheets("Score")
For i = 3 To 273 Step 10
.Range("D" & i).Resize(7, 11).ClearContents
Next
End With
End If
End Sub