If I comprehend your issue, you want a set of numbers applied to Sheet "Input," then run ertert, then apply the next set of numbers, the run ertert. . .Rinse and repeat.
In that case, Module 1 code should beHowever, Sub ertert runs on every contiguous block of cells on the entire sheet every time it runs, so it doesn't make sense to "Rinse and repeat."Option Explicit Sub ertert() Dim x, i&, j& With Sheets("Counter Totals") x = .Range("A2:CM" & .Cells(Rows.Count, 1).End(xlUp).Row).Value End With For i = 1 To UBound(x) 'The LBound of x is 0 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If (x(i, 1)) = "Game" Then j = j + 1 If (IsNumeric(x(i, 1))) * (Len(x(i, 1))) Then With Sheets("Game" & x(i, 1)).Columns(1).SpecialCells(2) .Areas(j)(.Areas(j).Count + 1, 1).Resize(, 91).Value = Application.Index(x, i, 0) End With End If Next i NumbersGrabber 'get more numbers '<<<<<<<<<<<<<<<<<<<<<< End Sub Sub ClearGames() 'as is End Sub Sub NumbersGrabber() Dim InputSht As Worksheet Dim DrnNumSht As Worksheet Static NextRowToUse As Long 'maintains State between calls as long as Workbook is open. With caveats. Set InputSht = Sheets("Input") Set DrnNumSht = Sheets("Drawn Numbers") If NextRowToUse = 0 Then NextRowToUse = 2500 If NextRowToUse = 1 Then Exit Sub DrnNumSht.Cells(NextRowToUse, "I").Resize(, 7).Copy 'Resize(0 Rows, 7 Columns) InputSht.Range("I49").Resize(, 7).Insert shift:=xlShiftDown NextRowToUse = NextRowToUse - 1 ertert 'Run the etert Procedure '<><><><><><><><><><><> End Sub
Further, ertert pulls values from Sheet "CounterTotals" and puts them in a Game sheet. NumbersGrabber puts values in Sheet "Input," but ertert doesn't use them.




Reply With Quote