Help with Looping to solve 'procedure too large' problem

C

chris100

Hi all,

Anyone help with looping this please - i need to perform the same
action as this until the numbers in red are say, 100). Alternatively
until a line to be copied is blank.


lrw = Sheets("BREAKDOWN").Cells(Rows.Count, "A").End(xlUp).Offset(1,
0).Row

Sheets("BREAKDOWN").Cells(lrw, 1) = Sheets("invoice").Range("cg7")
Sheets("BREAKDOWN").Cells(lrw, 2) = Sheets("invoice").Range("ch7")
Sheets("BREAKDOWN").Cells(lrw, 3) = Sheets("invoice").Range("ci7")
Sheets("BREAKDOWN").Cells(lrw, 4) = Sheets("invoice").Range("cj7")

Thanks for all the help. Could someone also recommend any links to
good looping examples?
 
N

Norie

Perhaps something like this.

Code:
--------------------

lrw = Sheets("BREAKDOWN").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Row

For I = 0 To 100
Sheets("BREAKDOWN").Cells(lrw, I + 1) = Sheets("invoice").Range("cg7").Offset(0, I)
Next I
 

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

Top