View Single Post
  #2   Report Post  
Ian
 
Posts: n/a
Default

This macro takes data lin A1 to A10 (change rin range to suit), and creates
the data as you illustrated in column B.

Sub script()
rout = 1
For rin = 1 To 10
Cells(rout, 2) = "Fixed line 1"
rout = rout + 1
Cells(rout, 2) = "Fixed line 2"
rout = rout + 1
Cells(rout, 2) = Cells(rin, 1)
rout = rout + 1
Cells(rout, 2) = "Fixed line 3"
rout = rout + 1
Next
End Sub

--
Ian
--
"BigIan" wrote in message
...
I'm trying to use Excel to generate a simple script text file but can't
seem
to get it right. The file follows a fixed repeating pattern like the one
shown below and I'm trying to get Excel to insert a line from a list (A1,
A2,
A3 etc) in the third line of the repeating pattern.
This is the type of file I'm trying to create:

Fixed line 1
Fixed line 2
Cell Info A1
Fixed line 3
Fixed line 1
Fixed line 2
Cell Info A2
Fixed line 3
Fixed line 1
Fixed line 2
Cell Info A3
Fixed line 3

Excel doesn't seem to be able to repeat this type of pattern unless maybe
there's a setting I can change.
Hope somebody can help with this.