![]() |
Change active cell properties with command button
Matt wrote:
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 Sub Macro1() ' ' Macro1 Macro ' Macro grabada el 30-01-2004 por Beto ' ' Selection.ClearFormats With Selection.Font .Name = "Wingdings" .Size = 20 .Bold = True End With Selection.Validation.Delete ActiveCell.FormulaR1C1 = "P" ActiveCell.Offset(1, 0).Select ActiveCell.Offset(-1, 0).Select End Sub This should do it. Just assign it to the CommandButton. The last two lines of code move awasy from the cell and then comes back, because I didn't find another way to eliminate the dropdown arrow of validation from the display. 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