Thread: [Solved] recording ranges in macros
View Single Post
 
Old 09-13-2017, 06:42 AM
ewso ewso is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2016
Posts: 80
ewso is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Try something along the lines of:
Code:
Sub Demo()
Dim r As Long, c As Long
With Selection
  For r = 2 To .Rows.Count Step 2
    For c = 1 To .Columns.Count
      ActiveCell.Offset(r - 1, c - 1).ClearContents
    Next
  Next
End With
End Sub
This will clear all selected cells in every second row of whatever you select.

thanks Macropod! that works!
Reply With Quote