Gavin Harrison
New Member
- Joined
- May 2, 2017
- Messages
- 34
Hi All.
I have some code below, which always errors on the paste special line. If anyone can help i would appreciate it.
It basically copys data from a hidden sheet and pastes the values into another sheet (which is determinted based on the value of a cell).
Sub Export()
If MsgBox("Are you sure, this will overwrite any existing data?", vbYesNo) = vbNo Then Exit Sub
ActiveWorkbook.Unprotect "aladdin"
Sheets("Calculations").Visible = True
Sheets("Calculations").Select
Range("ac69:af165").Copy
Sheets(Range("aa69").Value).Select
ActiveSheet.Unprotect "aladdin"
Range("A12").PasteSpecial Paste:=xlValues
ActiveSheet.Protect "aladdin"
Sheets("Calculations").Visible = False
ActiveWorkbook.Protect "aladdin", Structure:=True, Windows:=False
Range("A1:G1").Select
End Sub
Thanks in advance for any help.
I have some code below, which always errors on the paste special line. If anyone can help i would appreciate it.
It basically copys data from a hidden sheet and pastes the values into another sheet (which is determinted based on the value of a cell).
Sub Export()
If MsgBox("Are you sure, this will overwrite any existing data?", vbYesNo) = vbNo Then Exit Sub
ActiveWorkbook.Unprotect "aladdin"
Sheets("Calculations").Visible = True
Sheets("Calculations").Select
Range("ac69:af165").Copy
Sheets(Range("aa69").Value).Select
ActiveSheet.Unprotect "aladdin"
Range("A12").PasteSpecial Paste:=xlValues
ActiveSheet.Protect "aladdin"
Sheets("Calculations").Visible = False
ActiveWorkbook.Protect "aladdin", Structure:=True, Windows:=False
Range("A1:G1").Select
End Sub
Thanks in advance for any help.