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 / New Users / November 2006

Tip: Looking for answers? Try searching our database.

VBA using an image as a toggle switch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DonH - 09 Nov 2006 08:32 GMT
Hi hope you can help.

I know next to nothing about VBA and have adapted code below from stuff I
had.

I simply want to show hide portions of my page to cut down on screen
clutter/information overload.

I have assigned my macro to a screen image but was wondering if I could have
a hide and unhide under the same button.

Any help would be much appreciated

Call Unl
Application.ScreenUpdating = False
Rows("25:75").EntireRow.Hidden = True
Rows("98:148").EntireRow.Hidden = True
Rows("171:221").EntireRow.Hidden = True
Rows("244:294").EntireRow.Hidden = True
Rows("317:367").EntireRow.Hidden = True
   Range("K4").Select
    Calculate
  Call Pro

DonH
Bob Phillips - 09 Nov 2006 09:43 GMT
Call Unl
Application.ScreenUpdating = False
Rows("25:75").EntireRow.Hidden = Not Rows("25:75").EntireRow.Hidden
Rows("98:148").EntireRow.Hidden = Not Rows("98:148").EntireRow.Hidden
Rows("244:294").EntireRow.Hidden = Not Rows("244:294").EntireRow.Hidden
Rows("317:367").EntireRow.Hidden = Not Rows("317:367").EntireRow.Hidden
   Range("K4").Select
    Calculate
  Call Pro

Signature

HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

> Hi hope you can help.
>
[quoted text clipped - 21 lines]
>
> DonH
DonH - 09 Nov 2006 10:29 GMT
Thanks Bob :-) That worked fantastically.  I really am going to have to
learn VBA

Many thanks

DonH

> Call Unl
> Application.ScreenUpdating = False
[quoted text clipped - 32 lines]
>>
>> DonH
Dana DeLouis - 09 Nov 2006 14:08 GMT
Just an additional idea...

With Range("25:75,98:148,244:294,317:367").EntireRow
 .Hidden = Not .Hidden
End With

Signature

Dana DeLouis
Windows XP & Office 2003

> Thanks Bob :-) That worked fantastically.  I really am going to have to
> learn VBA
[quoted text clipped - 40 lines]
>>>
>>> DonH

Rate this thread:






 
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.