Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Billums
 
Posts: n/a
Default How do I change activex control properties from a macro

I want to change the properties of a button on a worksheet when the workbook
is opened so that if a cell contains a certain value the button is inactive
if the cell doesn't contain that value the button is active. I am using
Office XP.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default How do I change activex control properties from a macro

Quick sample: (Paste into This Workbook module) of your file:
and change accordingly (cells and values)

Private Sub Workbook_Open()
With Worksheets("Sheet1")
.CommandButton1.Enabled = True
If .Range("B4").Value = 6 Then
.CommandButton1.Enabled = False
End If
End With
End Sub


"Billums" wrote:

I want to change the properties of a button on a worksheet when the workbook
is opened so that if a cell contains a certain value the button is inactive
if the cell doesn't contain that value the button is active. I am using
Office XP.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Billums
 
Posts: n/a
Default How do I change activex control properties from a macro

Thanks for that. I have done this before (a long time ago) and when I tried
to do it now I couldn't get it to work. Why? Because I had omitted the period
at the beginning of the control name. :-(

"Jim May" wrote:

Quick sample: (Paste into This Workbook module) of your file:
and change accordingly (cells and values)

Private Sub Workbook_Open()
With Worksheets("Sheet1")
.CommandButton1.Enabled = True
If .Range("B4").Value = 6 Then
.CommandButton1.Enabled = False
End If
End With
End Sub


"Billums" wrote:

I want to change the properties of a button on a worksheet when the workbook
is opened so that if a cell contains a certain value the button is inactive
if the cell doesn't contain that value the button is active. I am using
Office XP.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Macro adjustment needed - need to change font color also nick s Excel Worksheet Functions 2 November 28th 05 05:50 PM
Change macro to paste as last sheet Chance224 Excel Discussion (Misc queries) 3 April 18th 05 08:09 PM
assign a macro to a control button ewan72 Excel Discussion (Misc queries) 1 December 3rd 04 02:04 PM
How do I link a macro to an ActiveX control? New Users to Excel 0 November 27th 04 11:04 AM
How do I link a macro to an ActiveX control? New Users to Excel 0 November 27th 04 11:04 AM


All times are GMT +1. The time now is 06:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"