ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Looping to solve 'procedure too large' problem (https://www.excelbanter.com/excel-programming/343546-help-looping-solve-procedure-too-large-problem.html)

chris100[_37_]

Help with Looping to solve 'procedure too large' problem
 

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?


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=478484


Norie

Help with Looping to solve 'procedure too large' problem
 

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

--------------------


--
Norie
------------------------------------------------------------------------
Norie's Profile: http://www.excelforum.com/member.php...o&userid=19362
View this thread: http://www.excelforum.com/showthread...hreadid=478484


chris100[_38_]

Help with Looping to solve 'procedure too large' problem
 

Thanks Norie, I'll give that a go.


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=478484



All times are GMT +1. The time now is 10:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com