Thread: [Solved] recording ranges in macros
View Single Post
 
Old 09-13-2017, 04:34 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote