Code worked until I messed with it. Tweak needed.
I wanted to move the pasting destination to begin at AA3 on Sheet C but I am now getting an error message regarding line 29 type mismatch
I wanted to move the pasting destination to begin at AA3 on Sheet C but I am now getting an error message regarding line 29 type mismatch
VBA Code:
Sub PopulateCEPrep()
Dim arrRanges() As String
Dim arrWorksheets() As String
Dim Ws As Worksheet
Dim i As Integer
Dim ii As Integer
Dim intRow As String
Dim rng As Range
ActiveWorkbook.Save
Worksheets("Sheet C").Activate
With Worksheets("Sheet C")
.Range("AA3:AA" & .Cells(.Rows.Count, "AA").End(xlUp).Row).Value = ""
End With
arrRanges = Split("B8:B33,B39:B64,B70:B95,B101:B126", ",")
arrWorksheets = Split("G,R,Y", ",")
intRow = 3
For i = LBound(arrWorksheets) To UBound(arrWorksheets)
For ii = LBound(arrRanges) To UBound(arrRanges)
For Each rng In Worksheets(arrWorksheets(i)).Range(arrRanges(ii))
If Len(Trim(rng.Value)) > 0 Then
Worksheets("Sheet C").Cells(intRow, 27).Value = rng.Value
intRow = intRow + 1
End If
Next rng
Next ii
Next i
Worksheets("Sheet C").Range("AA3").Select
'MsgBox intRow - 5 & " rows of data copied", vbOKOnly, "Confirmation"