Change active cell properties with command button

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

what code you have.
-----Original Message-----
I have a command button(cmdExempt) that when I click it,
I want it to first clear the formatting in the active
cell, then remove the data validation, then change the
font style to wingdings2, then set the font to bold, then
change the font size to 20, then type a "P" in the cell.
I cannot get it to work. Any help would be great.
Thanks. Matt
 
This is what I have

Private Sub cmdExempt_Click()
With ActiveCell
.ClearFormats = True
.Font.FontStyle = wingdings2
.Font.Bold = True
.Font.Size = 20
.Validation.ErrorMessage = False
.Value = "P"
End With
End Sub

I'm getting an "Object Required" error. Thanks.
 
Matt said:
This is what I have

Private Sub cmdExempt_Click()
With ActiveCell
.ClearFormats = True
.Font.FontStyle = wingdings2
.Font.Bold = True
.Font.Size = 20
.Validation.ErrorMessage = False
.Value = "P"
End With
End Sub

I'm getting an "Object Required" error. Thanks.

..ClearFormats doesn't need True.
..Validation.Delete should be used to eliminate a validation, not the
error message.

Regards,
 
Back
Top