New to Macro writing
Option Explicit
Sub Readcopylines()
Dim currentLine As Range
Dim counter As Long
Worksheets("sheet6").Activate
Set currentLine = Rows(3) '.Activate
' currentline now references row 3
counter = 3
' if you start with 3 and count by 2
' your number will never = 12, so you
' will loop to the bottom of the page
' I assumed you don't want to exceed 12
Do While counter < 12
Rows(counter + 15).Value = currentLine.Value
Range("A" & counter + 16) = "next"
counter = counter + 2
Loop
End Sub
Hard to tell what you really are trying to do, but run this and see what you
get.
Make sure there is some data in Row 3 of sheet 6.
--
Regards,
Tom Ogilvy
"Going in Circles" wrote:
I have read thru several articles on this site to get started writing Macros.
To get started I thought I would read some lines and paste them at the
bottom of the existing sheet to test my understanding (which is obviously
zip) I can't even get started. Here is what I wrote (one of many versions).
Sub Readcopylines
Worksheets("sheet6").Activate
Set currentline=worksheet.row(3).Activate
Dim counter
counter=3
Do While counter <12
currentline.Paste(Range("counter+15:counter+15"))
Range("A,counter+16") = "next"
counter = counter +2
Loop
End Sub
If someone could list the things I am doing wrong, I will go back and read
some more. Is there a good source of information to get started writing? I
feel completely frustrated with my abilty to get started on this.
Pam
|