Results 1 to 3 of 3

Filter and copy Table Formatting

Threaded View

danimal538 Filter and copy Table... 06-15-2016, 02:44 PM
mikeTRON Re: Filter and copy Table... 06-15-2016, 02:53 PM
danimal538 Re: Filter and copy Table... 06-15-2016, 04:06 PM
  1. #1
    Registered User
    Join Date
    09-01-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    5

    Filter and copy Table Formatting

    Hello,

    I recently inherited a spreadsheet my team uses to keep track of projects and assign them to team members. I found some things that almost worked but not quite.
    I Would like to have rows of the table copied from the main list of all projects to other sheets based on different statuses. I have created a macro that does this. However, I would like for the newly copied sheet to be formatted as a table. Since the amount of data changes I cannot simply pick a range to format as table I am attaching a sample workbook and part of the code. If any one could help I would really appreciate it. Also any help making the code look nicer would be helpful for future modifications as well.

    Sub Filter_Copy_To_New_Request()
    '
    ' Copto_New_Requests_Macro
    '
        'Clear Old Table'
        Set Rng = Range("New_Requests[#All]")
        Rng.ClearContents
    
        'Copy Wanted Data To New Request sheet'
        Sheets("All_Projects").Range("All_Projects[#All]") _
            .AdvancedFilter Action:=xlFilterCopy, _
            CriteriaRange:=Range("New_Requests!Criteria"), _
            CopyToRange:=Range("A2"), _
            Unique:=False
            
        'Format data as Table'
        Dim NR As Worksheet
        Set NR = Sheets("New_Requests")
        Set Col = Range(Selection, Selection.End(xlToRight))
        Set Row = Range(Selection, Selection.End(xlDown))
                NR.ListObjects.Add(xlSrcRange, Range("$A$2:$O$4"), , xlYes) _
                .Name = "New_Requests"
        Set NRA = Range("New_Requests[#All]")
                ActiveSheet.ListObjects("New_Requests").TableStyle = "TableStyleMedium7"
                
    End Sub
    Thanks,
    Dan
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How-to Copy and Paste Values from list into Pivot Table filter
    By MacroNerd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2013, 06:26 PM
  2. [SOLVED] Filter and Copy to another worksheet a table object - VBA
    By limalf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2013, 11:06 AM
  3. Filter list of values twice and copy rows to new table
    By Beekster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 07:36 AM
  4. Replies: 4
    Last Post: 01-15-2013, 05:34 PM
  5. Loop through filter and copy subtotal from cell NOT in table to other sheet
    By MStaretorp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2012, 02:41 PM
  6. Replies: 0
    Last Post: 03-22-2012, 02:45 PM
  7. macro to filter data table and copy it to another worksheet
    By jarssonn in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-07-2010, 01:28 AM

Tags for this Thread

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