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 / February 2007

Tip: Looking for answers? Try searching our database.

Alternative way to refer to a row to hide or unhide...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darin Kramer - 16 Feb 2007 14:55 GMT
Hi There,

I currently have a simple VB that selects data in row 60 and 61 (see
below).  Problem is that if a user adds lines (and its quite possible
that he may) the macro will not hide the correct row. Is there VB to
hide a named range...?

Kind regards

Darin

Rows("60:61").Select
   Selection.EntireRow.Hidden = True
Jim Jackson - 16 Feb 2007 15:05 GMT
Select the rows you want hidden, click in the address window (upper left of
sheet where you see the cell reference).  Type a name in that window to give
the selected rows a "Named Range".  Then put that name in your code in place
of the rows reference.  This way, when rows are added above, the named range
will remain constant.
Signature

Best wishes,

Jim

> Hi There,
>
[quoted text clipped - 11 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Gary''s Student - 16 Feb 2007 15:05 GMT
Assign a Named Range to the rows and use the name:

Sub demo()
Range("ready_for_hide").EntireRow.Hidden = True
End Sub

The named cells will adjust as rows are added or deleted.
Signature

Gary''s Student
gsnu200706

> Hi There,
>
[quoted text clipped - 11 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Darin Kramer - 16 Feb 2007 19:01 GMT
Awesome!! Thanks so much!
 
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.