I am completely new to the world of VB... and need some help resolving a "Compile Error: Procedure too large" problem.
I have a spreadsheet with two (2) columns of numbers: 1) Store # and 2) # of codes. I need to replicate the Store Number (Column 1) in a separate column as many times as the Number Of Codes (value in Column 2). My actual spreadsheet has 448 rows of data which must be replicate din this way.
Sample Columns:
StoreNumber Number of codes
29 75
67 75
71 125
Here's what I have created 448 times in a single Macro:
How do I create a nested FOR loop that will cycle through all 448 rows and produce approximately 44,625 cell values representing the Store Numbers replicated as many times as required by the Number of Codes column?![]()
Sub Copy_Paste() Dim i As Long For i = 1 To Range("B2") Range("A2").Copy Range("D" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues Next i For i = 1 To Range("B3") Range("A3").Copy Range("D" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues Next i For i = 1 To Range("B4") Range("A4").Copy Range("D" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues Next i End Sub
I really appreciate your help!
Chilton
Bookmarks