Dear all,
I've been looking for quite a while now.. I've been trying to copy and paste VALUE from worksheets (All except TEST), into the "MasterSheet".
Other worksheets have formulas from A15 : A50 - and I'm trying to only copy and paste the values that are not " ". (i.e. if empty, move onto next worksheet and copy from a15 - a x).
i've tried using the code below so far, I can see my formulas / data come out but it's getting overwritten by the final worksheets data (meaning instead of 4 pages of work stacked, it's 1 as the rest have been deleted).
Can someone help me? Any guidance is super appreciated..
I've been looking for quite a while now.. I've been trying to copy and paste VALUE from worksheets (All except TEST), into the "MasterSheet".
Other worksheets have formulas from A15 : A50 - and I'm trying to only copy and paste the values that are not " ". (i.e. if empty, move onto next worksheet and copy from a15 - a x).
i've tried using the code below so far, I can see my formulas / data come out but it's getting overwritten by the final worksheets data (meaning instead of 4 pages of work stacked, it's 1 as the rest have been deleted).
Can someone help me? Any guidance is super appreciated..
VBA Code:
Sub copypaste()
Sheets("MasterSheet").Select
Range("A20:A1000").Select
Selection.ClearContents
Dim J As Integer
Dim sh As Worksheet
Const excludeSheets As String = "test"
On Error Resume Next
For Each sh In ActiveWorkbook.Worksheets
If IsError(Application.Match(sh.Name, Split(excludeSheets, ","))) Then
Application.GoTo Sheets(sh.Name).[b3]
Range("A13:A50").Select
Selection.Copy
Worksheets("MasterSheet").Activate
Range("a1").End(xlUp).Offset(rowOffset:=10, columnOffset:=2).PasteSpecial xlPasteValues
End If
Next
Application.CutCopyMode = False
MsgBox "Master Updated"
End Sub
Last edited by a moderator: