ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Visibility Problem of Embedded Buttons in Worksheet (https://www.excelbanter.com/excel-programming/300689-re-visibility-problem-embedded-buttons-worksheet.html)

Dave Peterson[_3_]

Visibility Problem of Embedded Buttons in Worksheet
 
I'm not sure if you're experiencing a display problem or a problem in your
algorithm.

You may want to post your code to get a good response.

Anson wrote:

I am using the Excel 97 and have been trying to solve this problem for weeks. Wonder if anyone can help me on this:

I have embedded 5 command buttons, 3 combo boxes and 6 options buttons (3 groups) directly on one of the sheet in an Excel workbook. I have programmed it so that the combo boxes, options buttons and 2 of the command buttons to be invisible unless one button is clicked. When I click on another button (cancel), they should be invisible again. However, when I run the program, one combo box and 2 option butons are always visible and some command buttons are not visible when they should. I have checked the codes and also the grouping of the option buttons and they all make sense. I tried the same codes but replaced "Visible" with "Enabled" and they worked! Why can I enable and disable them but can't hide and unhide them? Are there anything I should be aware of when I set the visibility of the objects on the worksheets?


--

Dave Peterson


Anson

Visibility Problem of Embedded Buttons in Worksheet
 
Thanks, though I doubt that's because of the codes since I tried to set visible to false manually and it still wouldn't work. Here are my codes

Private Sub SortReset(

Application.EnableEvents = Fals
Application.ScreenUpdating = Fals

tbSort.Caption = "Sort
btnExtract.Visible = Tru
btnConsolidate.Visible = Tru

cBox1.Visible = False: cBox2.Visible = False: cBox3.Visible = Fals
cBox1.Value = Empty: cBox2.Value = Empty: cBox3.Value = Empt
cBox1.Clear: cBox2.Clear: cBox3.Clea
obSort1A = 0: obSort3A = 0: obSort3A =
obSort1D = 0: obSort3D = 0: obSort3D =
obSort1A.Visible = False: obSort2A.Visible = False: obSort3A.Visible = Fals
obSort1D.Visible = False: obSort2D.Visible = False: obSort3D.Visible = Fals
obSort1A.Caption = "": obSort2A.Caption = "": obSort3A.Caption = "
obSort1D.Caption = "": obSort2D.Caption = "": obSort3D.Caption = "
obSort1A = 1: obSort2A = 1: obSort3A =

btnSortExec.Visible = Fals

Application.EnableEvents = Tru
Application.ScreenUpdating = Tru

tbSort.Value = Fals

End Su


----- Dave Peterson wrote: ----

I'm not sure if you're experiencing a display problem or a problem in you
algorithm

You may want to post your code to get a good response

Anson wrote
I am using the Excel 97 and have been trying to solve this problem for weeks. Wonder if anyone can help me on this
I have embedded 5 command buttons, 3 combo boxes and 6 options buttons (3 groups) directly on one of the sheet in an Excel workbook. I have programmed it so that the combo boxes, options buttons and 2 of the command buttons to be invisible unless one button is clicked. When I click on another button (cancel), they should be invisible again. However, when I run the program, one combo box and 2 option butons are always visible and some command buttons are not visible when they should. I have checked the codes and also the grouping of the option buttons and they all make sense. I tried the same codes but replaced "Visible" with "Enabled" and they worked! Why can I enable and disable them but can't hide and unhide them? Are there anything I should be aware of when I set the visibility of the objects on the worksheets


--

Dave Peterso



Jon Peltier[_7_]

Visibility Problem of Embedded Buttons in Worksheet
 
You've got your ScreenUpdating turned off at the beginning, which is
surely going to prevent the changes from appearing.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Anson wrote:

Thanks, though I doubt that's because of the codes since I tried to set visible to false manually and it still wouldn't work. Here are my codes:

Private Sub SortReset()

Application.EnableEvents = False
Application.ScreenUpdating = False

tbSort.Caption = "Sort"
btnExtract.Visible = True
btnConsolidate.Visible = True

cBox1.Visible = False: cBox2.Visible = False: cBox3.Visible = False
cBox1.Value = Empty: cBox2.Value = Empty: cBox3.Value = Empty
cBox1.Clear: cBox2.Clear: cBox3.Clear
obSort1A = 0: obSort3A = 0: obSort3A = 0
obSort1D = 0: obSort3D = 0: obSort3D = 0
obSort1A.Visible = False: obSort2A.Visible = False: obSort3A.Visible = False
obSort1D.Visible = False: obSort2D.Visible = False: obSort3D.Visible = False
obSort1A.Caption = "": obSort2A.Caption = "": obSort3A.Caption = ""
obSort1D.Caption = "": obSort2D.Caption = "": obSort3D.Caption = ""
obSort1A = 1: obSort2A = 1: obSort3A = 1

btnSortExec.Visible = False

Application.EnableEvents = True
Application.ScreenUpdating = True

tbSort.Value = False

End Sub


----- Dave Peterson wrote: -----

I'm not sure if you're experiencing a display problem or a problem in your
algorithm.

You may want to post your code to get a good response.

Anson wrote:
I am using the Excel 97 and have been trying to solve this problem for weeks. Wonder if anyone can help me on this:
I have embedded 5 command buttons, 3 combo boxes and 6 options buttons (3 groups) directly on one of the sheet in an Excel workbook. I have programmed it so that the combo boxes, options buttons and 2 of the command buttons to be invisible unless one button is clicked. When I click on another button (cancel), they should be invisible again. However, when I run the program, one combo box and 2 option butons are always visible and some command buttons are not visible when they should. I have checked the codes and also the grouping of the option buttons and they all make sense. I tried the same codes but replaced "Visible" with "Enabled" and they worked! Why can I enable and disable them but can't hide and unhide them? Are there anything I should be aware of when I set the visibility of the objects on the worksheets?


--

Dave Peterson





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com