+ Reply to Thread
Results 1 to 3 of 3

Show only specified columns

  1. #1
    Paul
    Guest

    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. #2
    Toppers
    Guest

    RE: 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. #3
    Jim May
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1