Results 1 to 2 of 2

Dynamic Columns?

Threaded View

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    4

    Dynamic Columns?

    Good Day All.

    This is my first post - so bear with me

    I have a 6000+ row database with 5 columns across. The 5 columns have the following headings: Hair Color, Eye Color, Age, Location, and Salary.

    I have created macros that will filter each column based on criteria - for example:

    Sub Sector_HairColor()
        ActiveSheet.Range("$B$26:$I$6592").AutoFilter Field:=3, Criteria1:= _
            "=Blonde", Operator:=xlAnd
        Range("D26").Select
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 5296274
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
        Range("J10") = "Hair Color:"
        Range("K10") = "Blonde"
        Range("A6").Select
    End Sub
    As you can see, at cell J10 and K10, I list the filter that is used for a particular search. Some searches, will only have 2 search criteria, some may have all 5, etc.

    On a separate worksheet (in the workbook), I have a "Report Tab", my question (after a long build up) is how do I dynamically change the columns and values on the "Report" tab depending on the search that I perform? For example, if I did a two variable filter (Hair and Salary), those would be the only two columns on the report - if I did all five variables for the search, all columns would be on the report, and so on.

    I hope that makes sense.

    Thank you in advance.
    Last edited by arlu1201; 02-19-2013 at 02:52 PM. Reason: Use code tags in future.

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