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 2006

Tip: Looking for answers? Try searching our database.

Show only specified columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 20 Feb 2006 20:16 GMT
Hi,

Newbie question:   I have a row with mutliple sequences of weekdays (MO TU
WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU...) all containing
different values.  

What is the easiest way to show only a specified day...for example Wednesdays?

Many thanks.

Paul
Toppers - 20 Feb 2006 20:29 GMT
Paul,
            You could hide/unhide columns:

Sub HideselectedCol(byval Day as string)
For i = 1 To 256
If Cells(1, i) <> Day Then Columns(i).Hidden = True
Next i
End Sub

Sub mytest
HideSelectedCol "MO"
end

Sub UnHideselectedCol()
For i = 1 To 256
If Columns(i).Hidden = True Then Columns(i).Hidden = False
Next i
End Sub

> Hi,
>
[quoted text clipped - 7 lines]
>
> Paul
Jim May - 20 Feb 2006 21:16 GMT
Paste this into a Standard Module:

Code assumes your first  MO is in cell C1 and rightward from there..
Also Cell A1 contains your criteria say,  WE

Sub Foo()
Range("C1").Select
Do Until ActiveCell = ""
If ActiveCell.Value <> Range("A1").Value Then
ActiveCell.EntireColumn.Hidden = True
End If
ActiveCell.Offset(0, 1).Select
Loop
End Sub

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