Writing Macro

  • Thread starter Thread starter Tammy Klein
  • Start date Start date
T

Tammy Klein

I have never written a macro and need help with the code.
I need to take a set of data (1200 lines) and copy the
data for 26 weeks, incrementing the date by 7 days each
pass through. Any ideas as to what loop structure I
should use and what the code may look like?
 
Tazmmy,

Not clear where the date is, but let's assume in row 1, the code could be
something like

Dim i As Long, j As Long
For i = 2 To 26
Cells(1, i).Value = Cells(1, 1).Value + (i - 1) * 7
For j = 2 To 100
Cells(j, i).Value = Cells(j, 1).Value
Next j
Next i


--

HTH

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