I have a Name Range Called "Body" which references "='Daily Chgs'!$B$3:$BN$45,'Job Ticket'!$f$10:$h$52,'Job Ticket'!$M$10:$M$52,'Job Ticket'!$E$58"
I also have a macro For clearing the data in that range.
Sub Clear_Body()
'
' Clear_Header Macro
'
'
Dim YesOrNoAnswerToMessageBox As String
Dim QuestionToMessageBox As String
QuestionToMessageBox = "TO START NEW JOB TICKET ONLY: Are you sure you want to Clear: This Clears all data on your Daily Chgs also?"
YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbYesNo, "CLEAR?")
If YesOrNoAnswerToMessageBox = vbNo Then
Exit Sub
'MsgBox "Learn more VBA!"
Else
Application.GoTo Reference:="Body"
Selection.ClearContents
Range("A4:B4").Select
'MsgBox "Congratulations!"
End If
End Sub
When I select the macro to run i get a runtime error '1004 reference is not valid
This used to work when I cleared data only within one sheet ....I am now trying to clear a range of cells on another sheet also and now it wont run.
What would be the problem?
Bookmarks