Thread: making labels
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
stevebriz stevebriz is offline
external usenet poster
 
Posts: 195
Default making labels


Joanne wrote:
Thanks for your input
Sorry to say they do not work
The subroutines work on the first set of 3 lines doing what is
expected - then they grab the first line of the second set of 3 lines
and place it in C3, and then the loop ends.
Any ideas to fix this sure would be appreciated, as is your efforts so
far.
Again, thanks

excelent wrote:

Sub Xtst()
Dim r, I
r = Range("A1").CurrentRegion.Rows.Count
For I = 1 To r Step 2
Cells(I, 2) = Cells(I + 1, 1)
Cells(I, 3) = Cells(I + 2, 1)
Next
End Sub




Try this one I think it should work for you


Sub tst()
Sheet1.Select

Dim r As Integer
Dim I As Integer
Dim J As Integer

J = 1
r = Sheet1.Range("A1").CurrentRegion.Rows.Count
For I = 1 To r

Sheet2.Cells(J + 1, 1).Value = Sheet1.Cells(I, 1).Value
Sheet2.Cells(J + 2, 1).Value = Sheet1.Cells(I, 2).Value
Sheet2.Cells(J + 3, 1).Value = Sheet1.Cells(I, 3).Value
J = J + 3
Next I

End Sub