ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change active cell properties with command button (https://www.excelbanter.com/excel-programming/289731-change-active-cell-properties-command-button.html)

Nick

Change active cell properties with command button
 
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
.


matt

Change active cell properties with command button
 
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.

Beto[_3_]

Change active cell properties with command button
 
Matt wrote:

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,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.



All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com