Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Show only specified columns

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Show only specified columns

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

"Paul" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Show only specified columns

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


"Paul" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to show only the first three columns Padre310 Excel Worksheet Functions 3 April 1st 10 06:40 PM
Subtotal show more columns Mandy Excel Discussion (Misc queries) 1 April 21st 08 12:34 PM
Only show certain columns Woda Excel Worksheet Functions 1 March 15th 07 11:51 PM
Show data in columns flyer27 Excel Discussion (Misc queries) 1 March 13th 07 06:56 PM
show all columns in a worksheet huangx06[_4_] Excel Programming 2 July 8th 05 09:13 PM


All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"