+ Reply to Thread
Results 1 to 4 of 4

Please show me how to automatically add a blank column before each table

  1. #1
    Registered User
    Join Date
    12-25-2010
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    1

    Exclamation Please show me how to automatically add a blank column before each table

    Hi everybody,

    I have a task which needs automation with use of macro and I have written code to do it; however, my code could not do the task successfully. Therefore, I need your help now.

    I attached a sample file, including 3 sheets: “start_1”, “start_2” and “result”. “start_1” and “start_2” are identical. I need to format tables in these two sheets “start” so that they look like exactly the “result” sheet.

    In detail, here are tasks which need automating:
    - Add 1 blank row at top (I have done it)
    - Freeze title rows (I have done it)
    - This is what I could not do: Add 1 blank column before each table. The added column must have no fill color and no border at all. (Each table here is identified by merged cells in the top title row)
    - Also please show me how to determine the last column with data and the last row with data so that the blank outer space is hidden.

    Thank you very much for your help.

    Below is my code (in ThisWorkbook module):
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by vijnanamatrata; 07-02-2013 at 01:46 AM.

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Please show me how to automatically add a blank column before each table

    Hi vijnanamatrata!

    Please avoid using Cross-Post or provide us the link, so that we dont have to work on a solved (if already) query..

    http://chandoo.org/forums/topic/plea...ore-each-table
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Please show me how to automatically add a blank column before each table

    The problem your have, is you work with merged cells.

    to add an column A you have to choose an NON merged cell e.g. A2 and add the column.

    Please Login or Register  to view this content.
    This code you can implement in your own code.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Please show me how to automatically add a blank column before each table

    Does this help?

    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)

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