Wednesday, July 6, 2011

Compiling Worksheets : -


Sub CompileWOrksheets()
    Dim wksSheet As Worksheet
    With ThisWorkbook
    .Worksheets.Add.Name = "Compiled"
    For Each wksSheet In .Worksheets
        If wksSheet.Name <> "Compiled" Then
            wksSheet.UsedRange.Copy .Worksheets("Compiled").Range("A" & .Worksheets("Compiled").Range("A" & Rows.Count).End(xlUp).Row + 1)
        End If
    Next wksSheet
    End With
End Sub

No comments: