Excel - a Macro for copying data from different sheets [Closed]


I love your posting. I was just wondering if I could exclude some tabs from being copied. I am pulling information from pivot tables so I have a data source. So when the macros copies the data it also pastes the original source. Can you advise. This is your code:

Sub Master()
Dim j As Long, k As Long, r As Range
j = Worksheets.Count
With Worksheets("master")
Set r = Range(.Range("A2"), .Range("A2").End(xlDown))
End With
For k = 1 To j
If Worksheets(k).Name = "master" Then GoTo errorhandler
With Worksheets(k)
If .Range("A4") = "" Then GoTo errorhandler
Set r = Range(.Range("A4"), .Range("A4").End(xlDown))
Worksheets("master").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
End With
Next k
End Sub

Thanks a million.


Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!