+ Reply to Thread
Results 1 to 5 of 5

dynamic column reference, copy formula down

Hybrid View

  1. #1
    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
        With Sheets("Sheet1")
          with .Range(.cells(2, rPrCol), .cells(endRow, rPrCol))
              .FormulaR1C1 = "=ROUND(RC[-6],2)"
              .value = .value
              .entirecolumn.autofit
          end with
    end with
    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

  2. #2
    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.

+ 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