+ Reply to Thread
Results 1 to 1 of 1

Excel 2007 : Issue - Range.Row in range in formula is offset?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    1

    Issue - Range.Row in range in formula is offset?

    I'm trying to migrate VBA code from Excel 2000 to 2007.
    After all the initial issues and building a new Ribbon for the application, I'm now face with one sub that display a behaviour that I can't explain...

    Set dst_range = in_wrks_set.dst_wrks.Range("V2", "V" & format(in_rate_parm.maxnum_index)) '<--- This set the range to a column from row 2 to x...
    dst_range.Formula = "=generate_Dcode(RC)" ' '<--- This is where the problem arise...
    The formula uses the .row of the range (RC) pass to it, to generate a value that is used to link data from two sheets.

    Seems that when the formula "generate_Dcode" execute with the col range, the row are offsets in 2007!?!
    Instead of executing for row 2,3,4 up to the max row in the range... like in excel 2000, It's executing for row 3,5,7...
    Then comes back to do row 2,4,6....
    Which in the end generated mismatch between the two sheets.
    I have a work around by executing with a FOR ... EACH. But it's way slower. Ex.: 1 sec VS 12 sec average for 2000 rows.
    I can't find why it's behaving that way. I've change the .Formula for .FormulaR1C1, but this did not change anything.

    Thanks in advance and any help would be appreciated.
    Last edited by Paul; 06-19-2012 at 05:22 PM. Reason: Added CODE tags for new user. Please do so yourself in the future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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