Results 1 to 5 of 5

Macro to Turn Data Into Table (Column Shade Aren't Uniform)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Macro to Turn Data Into Table (Column Shade Aren't Uniform)

    Attachment 283202**I posted this question in the tables section of this forum as well because I'm unsure where it belongs.

    I created a macro to pull data from a table in one worksheet, and copy to a seperate worksheet.

    For the example that I attached:

    -The data in the Acct Number, Call Days, and Aging Since Code columns were pulled from a table in the seperate worksheet.

    -The Age Group columns are produced by a macro, filling in each cell with a formula, and based off of the column in front of them.

    -Supervisor Response column is left blank.


    At this point in the macro, there is a bunch of copied data, and columns A, B, and D are still colored like the table that they were copied from. The rest of the columns are not formatted yet. Now when my macro goes to format them all into one table, the formatting is different between columns. They have different shades, and have different border types. Why is this happening? I want all columns to be formatted identically, so it appears as a uniform table.

    Here is the macro for when it formats to a table:


    ''Orientation Call
    
    With Sheets("Orientation Call")
        'keeps from editing top 2 rows
        If WorksheetFunction.CountA(.Cells) = 0 Then
            LR = 3
        Else
            LR = Sheets("Orientation Call").Range("A:F").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        End If
        
        If LR <= 2 Then LR = 3
    
        With Sheets("Orientation Call").Range("A3:F" & LR).Font
            .Name = "Arial"
            .Size = 11
        End With
    
        With Sheets("Orientation Call").Range("A3:F" & LR)
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlCenter
        End With
    
    End With
    
    
    ''Removes format, and changes to table
    
    Sheets("Orientation Call").Select
        LR = Range("A1:F" & Rows.Count).Find("*", Range("A1"), xlValues, xlWhole, , xlPrevious).Row
        Range("A3:F" & LR).Select
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
        Range("A2:F" & LR).Select
        ActiveSheet.ListObjects.Add(xlSrcRange, Range("A2:F" & LR), , xlYes).Name = _
            "tOrientation"
            ActiveSheet.ListObjects("tOrientation").TableStyle = "TableStyleMedium15"
        Range("tOrientation[[#Headers],[CLIENT ID]]").Select
    Attached Files Attached Files
    Last edited by Gard5096; 12-11-2013 at 12:55 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need a Macro to select a column and turn it into a csv row of data
    By PostalMike in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2012, 06:51 PM
  2. [SOLVED] macro to shade every other group of data
    By tiger10012 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2011, 11:40 AM
  3. Replies: 1
    Last Post: 09-15-2010, 04:54 PM
  4. Replies: 2
    Last Post: 01-22-2010, 04:00 PM
  5. Excel 2007 : turn off autofilling of column in 2007 table/list?
    By The Headacher in forum Excel General
    Replies: 2
    Last Post: 01-21-2010, 03:33 AM

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