Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enable CommandButton1
Hello,
I have a spreadsheet with a CommandButton1. I have set the Enable properties to False. I also have a macro in the file I want to use to Enable the CommandButton1. I'm using the following code: CommandButton1.Enabled = True But it's not working to Enable CommandButton1. What have I done wrong? Thank you so much for your help, Terri |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enable CommandButton1
Hello Terri, Here is code you need to Enable your Command Button. Remeber when referencing the Command Button from to include the Worksheet in the reference. Public Sub EnableButton() Dim CmdBtn1 As Object Set CmdBtn1 = Worksheets("Sheet1").Shapes("CommandButton1") CmdBtn1.ControlFormat.Enabled = True End Sub Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=545719 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enable CommandButton1
Terri,
Make sure the code you have written resides in the Worksheet code Dave "Terri" wrote: Hello, I have a spreadsheet with a CommandButton1. I have set the Enable properties to False. I also have a macro in the file I want to use to Enable the CommandButton1. I'm using the following code: CommandButton1.Enabled = True But it's not working to Enable CommandButton1. What have I done wrong? Thank you so much for your help, Terri |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enable CommandButton1
Dave,
It does...it still doesn't change the properties for CommandButton1. Thank so much for your help, Terri "ExcelDave" wrote: Terri, Make sure the code you have written resides in the Worksheet code Dave "Terri" wrote: Hello, I have a spreadsheet with a CommandButton1. I have set the Enable properties to False. I also have a macro in the file I want to use to Enable the CommandButton1. I'm using the following code: CommandButton1.Enabled = True But it's not working to Enable CommandButton1. What have I done wrong? Thank you so much for your help, Terri |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enable CommandButton1
One way
if you deal with commandbutton directly from standard module code like sub commandbutton1test Worksheets("yourname").CommandButton1.Enabled = False end sub Worksheets("yourname") is Commandbutton1 reside so, change "yourname" and run the macro. if you put CommandButton1.Enabled = False in WorkSheet module, i think you need write some sub code looks like Worksheet method in Worksheet module to operate from standard module. keizi "Terri" wrote in message ... Hello, I have a spreadsheet with a CommandButton1. I have set the Enable properties to False. I also have a macro in the file I want to use to Enable the CommandButton1. I'm using the following code: CommandButton1.Enabled = True But it's not working to Enable CommandButton1. What have I done wrong? Thank you so much for your help, Terri |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW TO DO ENABLE ENABLE THE QUERY PARAMETER BUTTON? | Excel Worksheet Functions | |||
Enable Macros | Excel Discussion (Misc queries) | |||
Sub CommandButton1 help | Excel Worksheet Functions | |||
Enable Mcros | New Users to Excel | |||
How do I label a command button so it doesn't say CommandButton1? | Excel Discussion (Misc queries) |