Marco

  • Thread starter Thread starter Guest
  • Start date Start date
what do you mean by repeat? You just play it from the command bar with the
run button beside the record button you used to record it. If this is not
what you mean please specify
 
John,

Please refer to "Repeat a recorded macro" below.

I need to munipulate 3 rows of data into 1 and then repeat the process for
some 1500 records. The records are standard in their format.
 
You modify the code so that it is index based, not absolute, then ssetup a
loopp to manage it.

Say the recorder gave

Range("A2").Select
Selection.Value = 22
Range("B2").Select
Selection.Value = "Red"
Range("B2").Select
Selection.Value = "I dunno now"

first tidy it up

Range("A2").Value = 22
Range("B2").Value = "Red"
Range("B2").Value = "I dunno now"

then base it around one cell

With Range("A2")
.Value = 22
.Offset(0,1).Value = "Red" '1 column right
.Offset(0,2).Value = "I dunno now" '2 columns
End With

then put it in a loop

For i = 2 To 2
With Range("A" & i)
.Value = 22
.Offset(0,1).Value = "Red" '1 column right
.Offset(0,2).Value = "I dunno now" '2 columns
End With
Next i

then make the loop bigger

For i = 2 To 1500
With Range("A" & i)
.Value = 22
.Offset(0,1).Value = "Red" '1 column right
.Offset(0,2).Value = "I dunno now" '2 columns
End With
Next i



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Recording a Macro?? 3
Recording a Marco 2
enable marco in excel 2007 1
Ask user for input during marco 1
Macro will not work - Please help 4
Exporting a Macro 1
Protection macro 4
Record Macro Excel 2007 1

Back
Top