Consulting

Results 1 to 6 of 6

Thread: Solved: what are these filter things called and how do you add them

  1. #1
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location

    Solved: what are these filter things called and how do you add them

    there are these filters on the side of a worksheet i am trying to reproduce and i need to know how to add them in vba!

    http://tinypic.com/r/9ux9op/5
    ------------------------------------------------
    Happy Coding my friends

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is data grouping, and done like so

    [vba]
    Rows("2:5").Rows.Group
    [/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 Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    so if i wanted to make X groups based on empty cells in column A, if i do a loop and say group each one will it show up on the side in one set of groupings? or would each group get its own column on the side?
    ------------------------------------------------
    Happy Coding my friends

  4. #4
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    tried this
    [VBA]Dim cell as Range
    Dim x1 as integer, x2 as integer, i as integer

    x1 = 2
    For i=1 to 12

    For each cell in range("A" & x1 & ":A22")
    if cell.value = "" then
    x2 = cell.row
    Rows(x1 & ":" & x2).Rows.Group
    x1 = x2 + 1
    Exit For
    End if
    Next i
    Next cell[/VBA]
    ------------------------------------------------
    Happy Coding my friends

  5. #5
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,061
    Location
    Have a look in Excel help regarding Grouping, then macro record the process.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  6. #6
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    thank you very much, how many times do i have to turn to the macro recorder before i remember how awesome it is? no sense trying to record a function whose name you dont even know though so thanks again to both of you!

    cheers
    ------------------------------------------------
    Happy Coding my friends

Posting Permissions

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