View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Selecting a Pattern of Cells

To do the selection:

Sub test()
Dim r, r1 As Range
Set r1 = Range("A7")
For i = 14 To 140 Step 7
Set r1 = Union(r1, Cells(i, 1))
Next
MsgBox (r1.Address)



For Each r In r1
'
'
'
'enter your stuff
'
'
'
Next
End Sub

The first part defines the range. The second part allows processing for
each cell in that range.
--
Gary''s Student


"bodhisatvaofboogie" wrote:

What would a formula for a macro look like for selecting a specific pattern
of cells within a column. For example:

I would like to select every 7th cell of Column A. What I mean by that is,
select cell A7, and A14, A21, A28, A35, etc on down the line. Make
Sense???

Then I would like to follow up that selection by taking them all, cutting
them and moving them UP three rows, and Over to the right 4 columns. That
make sense??? I'm not having much luck gettin anywhere on this one.
Thanks!!!