Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Hiding a macro button


The following logic works in the microsoft excel objects section [sheet1
(input)]

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("product").Address Then
Module1.visible_sheets
End If
end sub

Then I have another macro turn on and off sheets as needed. However, I
would like to hide the "print" macro button if the user inputs a retirement
age < issue age. The user could change either the issue age or the
retirement age at anytime once they are on the input sheet.

Currently, I'm have the retirement age being dynamically updated with
different retirement options. Both the retirement age and issue age are cell
in the "input" sheet.

I believe that the following code would work if I knew how to activate it.

If Range("valid").value < 0 Then
Sheets("input").button17.Visible = False
End If
If Range("valid").value = 0 Then
Sheets("input").button17.Visible = True
End If

the valid field is found on input_info sheet (there is a good reason why the
the field is on a different sheet).

Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Hiding a macro button

Use the macro below in the sheet's code window. (The sheet where
Range("valid") resides.

Private Sub Worksheet_Change(ByVal Target As Range)
' Your Code goes here
End Sub
--
Best wishes,

Jim


"Brad" wrote:


The following logic works in the microsoft excel objects section [sheet1
(input)]

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("product").Address Then
Module1.visible_sheets
End If
end sub

Then I have another macro turn on and off sheets as needed. However, I
would like to hide the "print" macro button if the user inputs a retirement
age < issue age. The user could change either the issue age or the
retirement age at anytime once they are on the input sheet.

Currently, I'm have the retirement age being dynamically updated with
different retirement options. Both the retirement age and issue age are cell
in the "input" sheet.

I believe that the following code would work if I knew how to activate it.

If Range("valid").value < 0 Then
Sheets("input").button17.Visible = False
End If
If Range("valid").value = 0 Then
Sheets("input").button17.Visible = True
End If

the valid field is found on input_info sheet (there is a good reason why the
the field is on a different sheet).

Thanks in advance for your help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Hiding a macro button

I did what you suggested, went into the input sheet changes one of the ages
to trigger hiding the button and nothing happened.

The button is on the input sheet not the input_info sheet.

"Jim Jackson" wrote:

Use the macro below in the sheet's code window. (The sheet where
Range("valid") resides.

Private Sub Worksheet_Change(ByVal Target As Range)
' Your Code goes here
End Sub
--
Best wishes,

Jim


"Brad" wrote:


The following logic works in the microsoft excel objects section [sheet1
(input)]

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("product").Address Then
Module1.visible_sheets
End If
end sub

Then I have another macro turn on and off sheets as needed. However, I
would like to hide the "print" macro button if the user inputs a retirement
age < issue age. The user could change either the issue age or the
retirement age at anytime once they are on the input sheet.

Currently, I'm have the retirement age being dynamically updated with
different retirement options. Both the retirement age and issue age are cell
in the "input" sheet.

I believe that the following code would work if I knew how to activate it.

If Range("valid").value < 0 Then
Sheets("input").button17.Visible = False
End If
If Range("valid").value = 0 Then
Sheets("input").button17.Visible = True
End If

the valid field is found on input_info sheet (there is a good reason why the
the field is on a different sheet).

Thanks in advance for your help.

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
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Through a command button hiding rows Saz[_3_] Excel Programming 6 June 7th 06 04:29 PM
Hiding a Button gatesheadthunde[_2_] Excel Programming 8 November 14th 05 04:46 PM
hiding forms button bigtonyicu Excel Discussion (Misc queries) 1 August 11th 05 11:00 PM
HIDING A BUTTON Glenn Excel Programming 3 May 10th 05 07:54 PM


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