+ Reply to Thread
Results 1 to 4 of 4

Generate a code that changes automatically every month

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    New York
    MS-Off Ver
    Home and Office 2010
    Posts
    8

    Generate a code that changes automatically every month

    Hi Everyone,

    I have a page with a pivot table followed by a table right next to it that refers to cells on the pivot to calculate outputs. However every month when I refresh the pivot table, it extends one column to the right and if I don't insert a column in between the pivot and the table next to it I created, the pivot would overwrite first column of the table. Below I have created a code that will search for the first column of the table I have created and then inserts a column in between the Pivot table and the Table.

    My question is how can I make this continuous without me having to copy and paste the 'If then statements' and having to change the reference column every time? (Keep in mind I will have to keep updating the Macro). I also included a picture. Thanks in advance!

    **By the way I am new to the forum, hope I posted in the right section.



    Please Login or Register  to view this content.
    excel capture.PNG

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,367

    Re: Generate a code that changes automatically every month

    Maybe this:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-14-2014
    Location
    New York
    MS-Off Ver
    Home and Office 2010
    Posts
    8

    Re: Generate a code that changes automatically every month

    TMS much thanks. It works perfectly !!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,367

    Re: Generate a code that changes automatically every month

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. [SOLVED] Generate Currencies for last day of the month automatically.
    By omni13 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-09-2014, 09:28 AM
  2. Macro/VBA Code to Automatically Generate a Label Template
    By cxr5009 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2013, 08:14 PM
  3. Replies: 1
    Last Post: 11-22-2011, 08:11 AM
  4. [SOLVED] Excel month dropdown list to generate day of week and date for selected month
    By aaaaaaaa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-17-2010, 02:45 PM
  5. Automatically generate Code for a worksheet created by a macro
    By jthompson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2008, 06:56 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