excel-training-course - excel code

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » excel-training-course - Excel code

excel-training-course - Excel code

resolvedResolved · Low Priority · Version Standard

Robert has attended:
Excel VBA Intro Intermediate course

Excel code

What formula would I use to hide multiple objects more than ten), on a worksheet using a command button or an option button, and make them re-appear immediately instead of cascading.

RE: Excel code

Hi Robert,

Thanks for your question. But could you elaborate a bit further? There is no Excel function/formula for hiding objects.

Can you tell me what are you trying to create, e.g. a userform?

Regards,

Katie Woo
Microsoft Certified Trainer

RE: Excel code

Katie,


What I am trying to do is create a worksheet with multiple objects on it. When the worksheet is activated only selected buttons are visible and enabled or bisible and unabled. When a command button is selected other command buttons and option buttons become enabled and visible. What I need is for theses objects to appear all at once and when a second command button is selected the original objects return to their original state of not being visible or enabled.

I have created an Array statement which appears to work but still involves a lot of code.

RE: Excel code

Hi Robet

On the Worlsheets Activate Event you make the required buttons or other objects visible and all other buttons invisible. eg:

Private Sub Worksheet_Activate()

cmdButton1.Visible = True
cmdButton2.Visible = True

cmdButton3.Visible = False

optOption1.Visible = True
optOption2.Visible = False

End Sub


The above open the worksheet and shows only buttons 1 and 2.

The code below makes the second Opotion box visible andhides the secons button:

Private Sub optOption1_Click()

cmdButton1.Visible = True
cmdButton2.Visible = False

cmdButton3.Visible = False

optOption1.Visible = True
optOption2.Visible = True

End Sub


Hope this helps

Carlos


 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Go to source of a cell

The default setting in Excel is when you double click in a cell it actives the formula in the cell. If you have created a link and want to directly go to that link (say if on another sheet, click on Tools -options and take off the tick for eidt it directly in cell

View all Excel hints and tips


Server loaded in 0.08 secs.