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 / July 2008

Tip: Looking for answers? Try searching our database.

Hiding/Unhiding Rows in a worksheet based on the value of a checkbox.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R Tanner - 31 Jul 2008 17:00 GMT
Hi,

I am using the following code to try and hide/unhide a row in a
worksheet.  It hides the row just fine, but it won't unhide it. What
am I doing wrong??

If ActiveSheet.OLEObjects(1).Object.Value = True Then
   ActiveSheet.Range("EURUSD").EntireRow.Hidden = False
Else
    ActiveSheet.Range("EURUSD").EntireRow.Hidden = True
End If

I tried this code before and it didn't work either.

sheets("Data Layout").Range("EURUSD").EntireRow.Hidden=  _
    Not sheets("Data Layout").OleObjects(1).object.value

Much simpler, I only wish I could get it to work...Any ideas?

Thanks
StumpedAgain - 31 Jul 2008 18:36 GMT
I would recommend event programming like the following:

Private Sub CheckBox1_Click()

If ActiveSheet.CheckBox1.Value = True Then
   ActiveSheet.Range("EURUSD").EntireRow.Hidden = False
Else
    ActiveSheet.Range("EURUSD").EntireRow.Hidden = True
End If

End Sub

Signature

-SA

> Hi,
>
[quoted text clipped - 16 lines]
>
> Thanks
 
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.