Hi guys I am doing a uni project and I am having problems with my VBA coding. I got help with the coding from ARowbot on here and he has really been a big help. However for some reason whenever I run my code although it still does what it is meant to do, i still get error code '1004' and it says 'Application-defined or object defined error'. I really do not know how to get rid of the error. the code is shown below
Sub InsulationSAVE()
Dim i, p As Integer
' InsulationSAVE Macro
Sheets("InsulationMonthly").Unprotect
For i = 5 To 16
If Sheets("InsulationMONTHLY").Cells(4, i) = UCase(Format(Now, "mmm")) Then
p = Sheets("INSULATION").Range("G" & Rows.Count).End(3).Row
Sheets("INSULATION").Range("P5:P" & p).Copy
Sheets("InsulationMONTHLY").Cells(5, i).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("INSULATION").Range("J5:N" & p).ClearContents
Sheets("InsulationMONTHLY").Range(Cells(5, "E"), Cells(p, i)).Locked = True
Sheets("InsulationMONTHLY").Protect
Exit Sub
End If
Next i
End Sub
I have attached the file here below..UNI (F) STOCK TAKE 2015 N M.xlsm
Thanks guys
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Bookmarks