Change active cell properties with command button

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
 
G

Guest

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.
 
B

Beto

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top