Consulting

Results 1 to 3 of 3

Thread: Solved: Show the next months Lists

  1. #1
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location

    Solved: Show the next months Lists

    Guys,

    Hope you are well.
    I need your help to modify the vba code that I use for hide all the lists in entire row based on criteria.

    In this case, i want to show the list if this monht is August 08. then show the list for Sept 08. start from the 1st sept 08 to 30 Sept 08.

    Appreciate your help. thank you!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub HideNextMonth()
    Dim LastRow As Long

    With ActiveSheet

    .Columns("O").Insert
    .Range("O5").Value = "Key"
    LastRow = .Cells(.Rows.Count, "K").End(xlUp).Row
    .Range("O6").Resize(LastRow - 5).Formula = "=TEXT(K6,""mmyyyy"")"
    .Range("O5").Resize(LastRow - 4).AutoFilter _
    field:=1, Criteria1:=Format(DateSerial(Year(Date), Month(Date) + 1, 1), "mmyyyy")
    .Columns("O").Hidden = True
    End With
    End Sub

    Sub restoreWS()
    With ActiveSheet.Columns("O")
    .Hidden = False
    .Delete
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location
    Hi Bob,

    Work fine.
    As usual, Thank you so much.

    Best, Harto

Posting Permissions

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