Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Shapes.visible = false/true

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ctech - 21 Mar 2006 18:24 GMT
This macro just worked, it hid most of my combo boxes and list boxes
However now Im getting an error when trying to select the hidden comb
boxes.... is it not possible to select ( .visible = false ) shapes. Fo
so to make them visable again?

> Private Sub Number_CC_invloved()
>
> ' Hides/Unhides the other forms depending on how many numbers of c
> invloved.
> ' Created by Christian Simonsen 21/03/2006
> Dim mSheet
> Dim mCombo
> Dim mList
>
> i = data.Range("K14").Value
>
> '------------------ Hides/Unhides all forms --------------
>
> ' unhides all the forms
> For n = 2 To 10
> mSheet = "Sheet" & n
> Range(mSheet).Select
> Selection.EntireRow.Hidden = False
> Next n
>
> ' hides all the forms which is not needed
> For i = i + 1 To 10
> mSheet = "Sheet" & i
> Range(mSheet).Select
> Selection.EntireRow.Hidden = True
>
> Next i
>
> ' -----------Hides all combo boxes and List boxes ---------
>
> ' unhides all the combo boxes
> For n = 2 To 10
> mCombo = "CC_" & n
> combo.Shapes(mCombo).Select
> With Selection
> .Visible = True
> End With
> Next n
>
> ' unhides all the List boxes
> For n = 2 To 10
> mList = "cboSecondary_" & n
> combo.Shapes(mList).Select
> With Selection
> .Visible = True
> End With
> Next n
>
> ' -----------Un-Hides all combo boxes and List boxes ---------
>
> ' hides all the forms which is not needed
> For i = i + 1 To 10
> mList = "CC_" & i
> combo.Shapes(mList).Select
> With Selection
> .Visible = False
> End With
> Next i
>
> ' hides all the forms which is not needed
> For i = i + 1 To 10
> mList = "cboSecondary_" & i
> combo.Shapes(mList).Select
> With Selection
> .Visible = False
> End With
> Next i
>
> End Su

--
Ctec
Ctech - 22 Mar 2006 10:37 GMT
So can I not make a shape visible again after making it invisible

--
Ctec
EvolBob - 22 Mar 2006 15:25 GMT
This works for the shapes on the worksheet and toggles the visible state on/off.

With ActiveSheet.DrawingObjects
 .Visible = Not .Visible = msoTrue
End With

Regards
Robert McCurdy

This macro just worked, it hid most of my combo boxes and list boxes.
However now Im getting an error when trying to select the hidden combo
boxes.... is it not possible to select ( .visible = false ) shapes. For
so to make them visable again?

> Private Sub Number_CC_invloved()
>
[quoted text clipped - 65 lines]
>
> End Sub

Signature

Ctech

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.