Hey thanks for the quick reply! I've got a business trip next week and this code really saves me tons of time.
Sub Recommendation()
' Pulls all recommendations into the recommendations tab.
' Does NOT remove duplicates or merge cells.
Dim ws As Worksheet
Dim wsDest As Worksheet
Dim rngFound As Range
Dim arrData(1 To 65000, 1 To 9)
Dim DataIndex As Long
Dim strFirst As String
DataIndex = 0
Set wsDest = Sheets("Recommendations")
wsDest.Range("B6:M" & Rows.Count).ClearContents
For Each ws In Sheets
If ws.Name <> wsDest.Name Then
Set rngFound = ws.Range("L10:L" & Rows.Count).Find("*", ws.Cells(Rows.Count, "L"), xlValues, xlWhole)
If Not rngFound Is Nothing Then
strFirst = rngFound.Address
Do
DataIndex = DataIndex + 1
arrData(DataIndex, 1) = ws.Cells(rngFound.Row, "L").Text 'Recommendation
arrData(DataIndex, 2) = ws.Cells(rngFound.Row, "A").Text 'Section
arrData(DataIndex, 3) = ws.Cells(rngFound.Row, "F").Text 'Personnel Risk Ranking L
arrData(DataIndex, 4) = ws.Cells(rngFound.Row, "G").Text 'Personnel Risk Ranking S
arrData(DataIndex, 5) = ws.Cells(rngFound.Row, "H").Text 'Personnel Risk Ranking R
arrData(DataIndex, 6) = ws.Cells(rngFound.Row, "I").Text 'Environmental Risk Ranking L
arrData(DataIndex, 7) = ws.Cells(rngFound.Row, "J").Text 'Environmental Risk Ranking S
arrData(DataIndex, 8) = ws.Cells(rngFound.Row, "K").Text 'Environmental Risk Ranking R
arrData(DataIndex, 9) = ws.Cells(rngFound.Row, "M").Text 'Person Responsible
Set rngFound = ws.Range("L10:L" & Rows.Count).Find("*", rngFound, xlValues, xlWhole)
Loop While rngFound.Address <> strFirst
End If
End If
Next ws
If DataIndex > 0 Then wsDest.Range("B6").Resize(DataIndex, UBound(arrData, 2)).Value = arrData
Set ws = Nothing
Set wsDest = Nothing
Set rngFound = Nothing
Erase arrData
End Sub
I don't think I changed it but it's obviously possible I did
Bookmarks