Hello jarssonn,
I made the changes you wanted. Here is the revised macro. This has been added to the attached workbook.
'Written: June 28, 2010
'Updated: June 29, 2010 - Extended Name, Current Role, and Site information to all cells
'Author: Leith Ross
Sub InternalSummary()
Dim LastRow As Long
Dim R As Long
Dim Rng As Range
Dim RngEnd As Range
Dim SumWks As Worksheet
Dim Wks As Worksheet
R = 2 'Starting row on the Summary Sheet
LastRow = 25 'Last row of Internal Training
Set SumWks = Worksheets("Summary Sheet")
For Each Wks In Worksheets
If Wks.Name <> SumWks.Name And Wks.Name <> "CATS" Then
Set Rng = Wks.Range("A10:I10")
Set RngEnd = Wks.Cells(LastRow, Rng.Column).End(xlUp)
If RngEnd.Row >= Rng.Row Then
Set Rng = Wks.Range(Rng, RngEnd)
SumWks.Cells(R, "A") = Wks.Cells(2, "B") 'Name
SumWks.Cells(R, "B") = Wks.Cells(3, "B") 'Current Role
SumWks.Cells(R, "C") = Wks.Cells(4, "B") 'Site
SumWks.Cells(R, "D").Resize(Rng.Rows.Count, 9).Value = Rng.Value
SumWks.Range("A" & R & ":C" & R + Rng.Rows.Count - 1).Value = _
WorksheetFunction.Transpose(Wks.Range("B2:B4").Value)
R = R + Rng.Rows.Count
End If
End If
Next Wks
End Sub
Bookmarks