+ Reply to Thread
Results 1 to 3 of 3

VBA code to automatically change column reference in formula

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    berlin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question VBA code to automatically change column reference in formula

    Hi everyone

    I am pretty new to VBA / Macros and would be so grateful if someone could help me solving my problem.

    I have a big excelfile with different tabs that are linked to SAP. So every month (after conducting a refresh) there is a new column showing up in these tabs with the data of the latest month.
    As I also maintain an overview tab that refers and aggregates the data of the current month through formulas, I had to change the column reference in these formulas every month.

    i.e. one of the formulas may look like this:

    =IF(ISNA(INDEX(BFD_Detail_PE!$P:$P,MATCH(1,(BFD_Detail_PE!$B:$B=B27)*(BFD_Detail_PE!$C:$C=$D$12),0))*(-1)),0,INDEX(BFD_Detail_PE!$P:$P,MATCH(1,(BFD_Detail_PE!$B:$B=B27)*(BFD_Detail_PE!$C:$C=$D$12),0))*(-1))

    => column reference for current month is column: BFD_Detail_PE!$P:$P , which needs to be changed to BFD_Detail_PE!$Q:$Q for the next month.

    Is there a vba code that would simplify the step of changing the column reference?


    Thank you very much in advance for any help! very much appreciated.

    Best
    Lucia

  2. #2
    Registered User
    Join Date
    01-07-2013
    Location
    berlin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA code to automatically change column reference in formula

    anyone ?

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    berlin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA code to automatically change column reference in formula

    Hi everyone

    This is a quite urgent issue of mine... Therefore I would be very grateful if someone could help me...?

+ 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. Replies: 1
    Last Post: 02-11-2015, 01:56 PM
  2. [SOLVED] How to change reference area automatically by dragging Index Match Formula down
    By Nuada in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2013, 01:19 PM
  3. Change column reference while dragging formula vertically
    By ekatecohn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2013, 07:23 PM
  4. Formula To Automatically Change External Reference Based on Date
    By Hillary35 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-29-2013, 11:39 AM
  5. [SOLVED] Need a code or formula that will automatically change the named range in my formulas
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 11:24 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