Increasing cell address by a set amount
I'm not sure what "and on and on" means, but you could change the lastrow
variable to the row number where you want to stop:
Option Explicit
Sub testme()
Dim iRow As Long
Dim LastRow As Long
Dim FirstRow As Long
Dim myCol As Long
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
With wks
FirstRow = 8
LastRow = 248
myCol = 2
For iRow = FirstRow To LastRow Step 80
myCol = myCol + 1
.Cells(iRow, "B").Formula _
= "='Date Details'!" & .Cells(5, myCol).Address(0, 0)
.Cells(iRow + 2, "B").Formula _
= "='Date Details'!" & .Cells(7, myCol).Address(0, 0)
.Cells(iRow + 3, "B").Formula _
= "='Date Details'!" & .Cells(3, myCol).Address(0, 0)
.Cells(iRow + 6, "B").Formula _
= "='Date Details'!" & .Cells(16, myCol).Address(0, 0)
Next iRow
End With
End Sub
stew wrote:
Dear All
I was orginally helped with a similar problem by Sandy Mann but I have come
to grief again. Can anybody give a formula that can do the Business
In b8 I have ' date details'!c5
In b10 I have 'date details'!c7
In b11 I have 'date details'!c3
In b14 I have 'date details'!c16
In b88 I wan to have ' date details'!d5
In b90 I want to have 'date details'!d7
In b91 I want to have 'date details'!d3
In b94 I want to have 'date details'!d16
In b168 I wan to have ' date details'!e5
In b170 I want to have 'date details'!e7
In b171 I want to have 'date details'!e3
In b174 I want to have 'date details'!e16
and on and on
Thanks in advance for looking
--
Dave Peterson
|