+ Reply to Thread
Results 1 to 3 of 3

Dynamic Columns? (this time with example)

Hybrid View

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

    Dynamic Columns? (this time with example)

    I am trying to create dynamic columns on a report tab, based on pre-defined filter sorts. The issue is I cannot figure out how to automatically change the headings and number of columns.

    See example.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,760

    Re: Dynamic Columns? (this time with example)

    You could try adding these lines to your "Blond" macro:

    ActiveSheet.AutoFilter.Range.Copy
    Sheets("Report").Activate
    Range("B2").PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    Columns("D:G").Delete
    Columns("B:C").AutoFit
    For macros "Age" and "State" you just modify which columns to delete and which should be "Autofit".

    If you don't wish to add the headings to your report use

    ActiveSheet.AutoFilter.Range.Offset(1).Copy
    Alf

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

    Re: Dynamic Columns? (this time with example)

    Thank you Alf. I am trying the code.

+ 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