Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Enabling a Embedded Control

Kirk, try somnething like this. Note that the button will not be disabled
(Enabled = False), but that it just won't do anything unless the WksUpdated
function returns True.

Option Explicit

Private Sub CommandButton1_Click()
Dim WksUpdated As Boolean
If WksUpdated Then
MsgBox "It must be updated!" 'code to run if updated goes here
Else
MsgBox "Apparently not updated!"
End If
End Sub

Private Function WksUpdated() As Boolean
If Range("A1").Value = True Then 'example of "updated correctly"
WksUpdated = True
Else
WksUpdated = False
End If
End Function

"Kirk" wrote in message
...
I added a command button control to a spreadsheet. I
have it intially disabled, but want to enable it after
the spreadsheet has been updated correctly. I want to
enable it through VBA code. How do I do this? I'm sure
it is simple and I am overlooking something.

As always, all help is appreciated.

Thanks.

Kirk



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
Enabling Macros Saxman[_3_] Excel Discussion (Misc queries) 3 November 15th 08 06:59 PM
Enabling a textbox K1KKKA Excel Discussion (Misc queries) 2 October 15th 07 09:21 PM
Enabling Events Robin Clay Excel Discussion (Misc queries) 8 July 12th 06 03:07 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Enabling macros Tom Ogilvy Excel Programming 0 August 18th 03 03:48 PM


All times are GMT +1. The time now is 11:31 PM.

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"