+ Reply to Thread
Results 1 to 6 of 6

Formatting to carry to next column in table

  1. #1
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Formatting to carry to next column in table

    I have several queries that upload data onto my worksheet vertically, which is the desired layout. The problem is that when new data is added after refresh and table expands sideways (new columns added to the right), formatting rules do not carry over. Therefore I must manually make the correction. Also I have a subsequent row ("Comments") which has formulas referencing data from the column.

    So I am needed a VBA code which carries formatting rules over to next column if there is a new entry in cell B1.
    Also need a code to extend formula AND formatting rules from B10 to C10 if there is a new entry in cell B1.

    thank you
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Formatting to carry to next column in table

    Hi...

    I'm sorry if I can't replicate your condition.
    Anyway, I macro recording your Conditional Formatting in cell B6 and then make the code below
    Please Login or Register  to view this content.
    The code will apply your conditional formatting (cell B6) and your concatenate formula (cell B10)
    across to the right based on how many columns your "Incidents" table has.

    So after you refresh your table, your table will expand to the right and has more column header.
    Rather you make another conditional formatting and the concat formula manually,
    you can assign the macro above to a button then click it.

    Next thing is maybe you can try to have another code in Sheet1 module :
    Please Login or Register  to view this content.
    Hopefully with the addition code like above, when you refresh your "Incidents" table,
    it will trigger the Worksheet_Change event and run the test sub without you have to click the button.
    Last edited by karmapala; 02-20-2022 at 10:01 PM.

  3. #3
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Re: Formatting to carry to next column in table

    Would you mind adding the coding sequence to my attached sheet so I can understand and duplicate the steps on my own?

  4. #4
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Formatting to carry to next column in table

    Please have a look to the attached file
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Re: Formatting to carry to next column in table

    Thanks.....that is exactly what I was looking for.

    Question: I plan to create a macro button to refresh (Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False).

    Could I attach this code to the refresh code so Refresh and Formatting can work simultaneously?

  6. #6
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Formatting to carry to next column in table

    Hi....
    Sorry I just realize that it can do by just copying the conditional formatted cell
    then paste across to the right as many as the columns header are there in the table "Incidents".
    So there's no need to code the conditional formatting.

    Could I attach this code to the refresh code so Refresh and Formatting can work simultaneously?
    Yes, I think it can.

    Please try the revised code below, added with your refresh code line

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Carry information from Column accross work sheet
    By mlopez60120 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-13-2016, 12:42 PM
  2. [SOLVED] Conditional Format carry over to next row in table
    By skylinekiller in forum Excel General
    Replies: 7
    Last Post: 05-04-2014, 09:37 AM
  3. Carry over Formatting from Excel to Access
    By FallingDown in forum Access Tables & Databases
    Replies: 8
    Last Post: 11-01-2013, 12:59 PM
  4. [SOLVED] Pasting a range from an Excel workbook to Outlook sometimes doesnt carry formatting over
    By mbhc77 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 08-28-2012, 11:41 AM
  5. [SOLVED] Formulas autofill ok but continues to carry tot from 1st column??
    By ET in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2006, 11:00 AM
  6. How can I carry cell formatting in paste link
    By bre in forum Excel General
    Replies: 5
    Last Post: 04-24-2006, 12:02 AM
  7. Replies: 1
    Last Post: 01-29-2006, 07:30 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