Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default disable macros in a worksheet

Hi...

I have a workbook with 10 sheets with 15 buttons (with macros) per sheet. Is
it possible to enable/disable these buttons based on a a value entered in a
cell?

e.g. If the user enters a value into cell A1 he can begin to navigate the
workbook using the buttons/macros?

Someone must be clever out there.

Thanks

G
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default disable macros in a worksheet

You need to add a validation routinte to each command button that checks the
value of cell A1. Depending on the value exit sub or continue. There is no
silver bullet on this one...
--
HTH...

Jim Thomlinson


"Gordon" wrote:

Hi...

I have a workbook with 10 sheets with 15 buttons (with macros) per sheet. Is
it possible to enable/disable these buttons based on a a value entered in a
cell?

e.g. If the user enters a value into cell A1 he can begin to navigate the
workbook using the buttons/macros?

Someone must be clever out there.

Thanks

G

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default disable macros in a worksheet

Hi...Where do I find the validation option in the code settings for the
command button?

"Jim Thomlinson" wrote:

You need to add a validation routinte to each command button that checks the
value of cell A1. Depending on the value exit sub or continue. There is no
silver bullet on this one...
--
HTH...

Jim Thomlinson


"Gordon" wrote:

Hi...

I have a workbook with 10 sheets with 15 buttons (with macros) per sheet. Is
it possible to enable/disable these buttons based on a a value entered in a
cell?

e.g. If the user enters a value into cell A1 he can begin to navigate the
workbook using the buttons/macros?

Someone must be clever out there.

Thanks

G

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default disable macros in a worksheet

You did mean CommandButton when you said "button", right?

Which "buttons" did you use... the ones from Form's toolbar or the Control
Toolbox toolbar?

--
Rick (MVP - Excel)


"Gordon" wrote in message
...
Hi...

I have a workbook with 10 sheets with 15 buttons (with macros) per sheet.
Is
it possible to enable/disable these buttons based on a a value entered in
a
cell?

e.g. If the user enters a value into cell A1 he can begin to navigate the
workbook using the buttons/macros?

Someone must be clever out there.

Thanks

G


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default disable macros in a worksheet

You build it yourself

Private Sub CommandButton1_Click()
If Not IsGoodToGo Then Exit Sub
End Sub

Public Function IsGoodToGo() As Boolean
IsGoodToGo = False
If Range("A1").Value = "Something" Then IsGoodToGo = True
End Function

--
HTH...

Jim Thomlinson


"Gordon" wrote:

Hi...Where do I find the validation option in the code settings for the
command button?

"Jim Thomlinson" wrote:

You need to add a validation routinte to each command button that checks the
value of cell A1. Depending on the value exit sub or continue. There is no
silver bullet on this one...
--
HTH...

Jim Thomlinson


"Gordon" wrote:

Hi...

I have a workbook with 10 sheets with 15 buttons (with macros) per sheet. Is
it possible to enable/disable these buttons based on a a value entered in a
cell?

e.g. If the user enters a value into cell A1 he can begin to navigate the
workbook using the buttons/macros?

Someone must be clever out there.

Thanks

G



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default disable macros in a worksheet

I was able to do the following with CommandButton1 using Control Toolbox and
Sheet1 Object:
Private Sub CommandButton1_Click()
Range("A2").Value = "Cochrane"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = "Orion" Then
CommandButton1.Enabled = True
Else: CommandButton1.Enabled = False
End If
End Sub

I tested it and it works. Substitute with your CommandButton1_Click actions.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Gordon" wrote:

Hi...

I have a workbook with 10 sheets with 15 buttons (with macros) per sheet. Is
it possible to enable/disable these buttons based on a a value entered in a
cell?

e.g. If the user enters a value into cell A1 he can begin to navigate the
workbook using the buttons/macros?

Someone must be clever out there.

Thanks

G

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
Disable Macros through VBA [email protected] Excel Programming 3 January 29th 07 10:01 AM
how do i disable macros? whatzzup Excel Discussion (Misc queries) 1 March 14th 06 01:51 PM
disable macros? me[_9_] Excel Programming 1 October 28th 05 11:07 PM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM
en-/disable macros pop-up James[_10_] Excel Programming 1 July 22nd 03 05:55 PM


All times are GMT +1. The time now is 01:19 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"