Hey,
I have designed a button to run a macro which deletes old information when pressed. I wanted to have a vbYesNo MsgBox popup to ask the user if the are sure they wish to delete data. This macro seems to work fine and completes its task but once it is finished I am getting "Object Required" Error.
my code is below:
________________________________________________________
Sub DeleteButton()
Dim Question As Byte, Type1 As Integer
Type1 = vbYesNo + vbcaution + vbDefaultButton2
Question = MsgBox("Are you sure you want to delete the current information from this spreadsheet?", Type1)
If Question = vbYes Then Macro1
If button6.Click Then 'Question'
End If
End Sub
________________________________________________________
As said above the code seems to work fine but I am getting the object required error anyway.
Could someone please tell me what I am doing wrong?
Thanks,
Andrew
I have designed a button to run a macro which deletes old information when pressed. I wanted to have a vbYesNo MsgBox popup to ask the user if the are sure they wish to delete data. This macro seems to work fine and completes its task but once it is finished I am getting "Object Required" Error.
my code is below:
________________________________________________________
Sub DeleteButton()
Dim Question As Byte, Type1 As Integer
Type1 = vbYesNo + vbcaution + vbDefaultButton2
Question = MsgBox("Are you sure you want to delete the current information from this spreadsheet?", Type1)
If Question = vbYes Then Macro1
If button6.Click Then 'Question'
End If
End Sub
________________________________________________________
As said above the code seems to work fine but I am getting the object required error anyway.
Could someone please tell me what I am doing wrong?
Thanks,
Andrew
Last edited: