Project217
New Member
- Joined
- Mar 7, 2022
- Messages
- 24
- Office Version
- 365
- Platform
- MacOS
Hi all.
Im Just having some trouble with the below VBA, works the first time perfectly but every second time it crashes and comes up with run time error 1004 PasteSpecial method of range class failed.
Also, I'm looking to add to this macro an email alert with just text only,
Any help would be awesome.
Sub PastTableToMasterSheet()
ActiveSheet.Unprotect Password:=""
Range("Table34").Copy
Sheets("Master Sheet").Unprotect Password:=""
Sheets("Master Sheet").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulas
Sheets("Master Sheet").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=""
Application.CutCopyMode = False
Rows("26:26").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.DELETE Shift:=xlUp
Range("B12").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=""
MsgBox "Order Sent"
End Sub
Im Just having some trouble with the below VBA, works the first time perfectly but every second time it crashes and comes up with run time error 1004 PasteSpecial method of range class failed.
Also, I'm looking to add to this macro an email alert with just text only,
Any help would be awesome.
Sub PastTableToMasterSheet()
ActiveSheet.Unprotect Password:=""
Range("Table34").Copy
Sheets("Master Sheet").Unprotect Password:=""
Sheets("Master Sheet").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulas
Sheets("Master Sheet").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=""
Application.CutCopyMode = False
Rows("26:26").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.DELETE Shift:=xlUp
Range("B12").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=""
MsgBox "Order Sent"
End Sub