Amendment need to Macro !

B

Bob

Amendment need to Macro !
This macro copies a cell down every 72 cells till 5112, Is it possible to
have a Macro copy a selection of cells down the same after highlighting
them?

Public Sub CopySelectionEvery72UntilRow5112()
Dim i As Long
Dim destRng As Range

With Selection(1)
Set destRng = .Cells
For i = .Row + 72 To 5112 Step 72
Set destRng = Union(destRng, Cells(i, .Column))
Next i
.Copy destRng
End With
End Sub

--
Thanks in advance for your help....Bob Vance
..
..
..
..
 
B

Bob Phillips

Bob,

Just remove the (1) from the
With Selection(1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob

Is it really that easy? Sorry

--
Thanks in advance for your help....Bob Vance
..
..
..
..
 
B

Bob Phillips

Bob,

I think it is, at least if I understood the question.

Selection is a range, and by putting (1) at the end, you restrict it to the
first cell in the selection.

The versatility of the Excel model!

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob

That worked great, how could I change it to take the formats like merged
cells with drop down lists cells

--
Thanks in advance for your help....Bob Vance
..
..
..
..

Gord Dibben said:
Bob

Remove the (1) from With Selection(1)

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top