Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Through a command button hiding rows | Excel Programming | |||
Hiding a Button | Excel Programming | |||
hiding forms button | Excel Discussion (Misc queries) | |||
HIDING A BUTTON | Excel Programming |