+ Reply to Thread
Results 1 to 3 of 3

Refer to cells in formula using column headers

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Refer to cells in formula using column headers

    The problem is that in other versions of Sheet1, a sample of the worksheet data is provided in the image below, the data in columns C through F may be in different columns (e.g the data in column A in version 1 of Sheet1 may be in column X in version 2 of Sheet1). I'm trying to make the macro more flexible by having the formulas in the macro somehow refer to the relevant cell by using the column name (i.e. the names in row 1), instead of using only R1C1 notation.
    Here is my code:

    Please Login or Register  to view this content.

    hYrF0.png


    Any help is much appreciated.
    Regards,

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Refer to cells in formula using column headers

    This shows how to find "Indicator3" and adjust the formula to match that column instead of always referring to column E: instead of

    RC[4]

    you use a variable like:

    RC[" & Ind3Column - 1 & "]

    You will need to change the other column references as well.....

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Refer to cells in formula using column headers

    Great! Thanks!

+ 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] listbox with column headers as a specific sheet column headers
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2014, 04:40 AM
  2. Replies: 2
    Last Post: 09-10-2012, 10:05 AM
  3. Row & Column headings to refer to cells in VBA6
    By Geetha Gupta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2009, 02:47 AM
  4. Formula to refer to changing Column
    By Kenny Markhardt in forum Excel General
    Replies: 1
    Last Post: 10-10-2005, 07:05 PM
  5. How to refer to current column in a formula?
    By jmg092548 in forum Excel General
    Replies: 4
    Last Post: 08-10-2005, 03:05 PM

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