+ Reply to Thread
Results 1 to 5 of 5

dynamic column reference, copy formula down

  1. #1
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    dynamic column reference, copy formula down

    Ive got this macro rounding numbers and copying the formula down but not sure how to make a dynamic column reference.
    In the code ive put the header Price2 in column I specifically, this wouldnt be the case normally, in reality id have to search for the header "Price2" which probably
    wont be in 'column I' ..how would i make the references to the "Price2" header dynamic?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by intothewild; 12-03-2012 at 06:28 PM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: dynamic column reference, copy formula down

    amend the last part to
    Please Login or Register  to view this content.
    as long as the formula should always look 6 columns to the left
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: dynamic column reference, copy formula down

    thats the thing, the 'Price2' header can be on any column (thats why i have this bit... Find("Price2", LookAt:=xlWhole).Column) and the dataset will have more columns from time to time, so that the 'Price2' header can more than 6 columns from column C where the origianl 'Price' column is located.
    Last edited by intothewild; 12-03-2012 at 06:28 PM.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: dynamic column reference, copy formula down

    so do you need the code to look at the Price column wherever that may be? if so the formula will be
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: dynamic column reference, copy formula down

    many many thanks Joseph, this works nicely:

    Please Login or Register  to view this content.
    Last edited by intothewild; 12-03-2012 at 06:22 PM.

+ 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