+ Reply to Thread
Results 1 to 3 of 3

Isolating formulas to work only on native worksheet

  1. #1
    Registered User
    Join Date
    03-28-2008
    Posts
    10

    Question Isolating formulas to work only on native worksheet

    This function is supposed to take a column of monthly returns and calculate the growth of $1000 over that time period.

    For example: 'Results08'!B50--> =Growth1K(B:B,1)

    When I calculate the result while I'm on the Results08 worksheet, the formula works great. The problem is that whenever any other cell gets recalculated on any other worksheet (ex Results07), cell 'Results08'!B50 uses the data from THAT worksheet for the calculation instead of the one it's supposed to use.

    I have scoured the forums looking for an answer and I thought the code below would do the trick, but I'm still getting the same result.

    The functions firstRow/lastRow return the number of the row where the first/last monthly return is for that column

    Please Help, I have wasted two days of work trying to figure this out!
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Masik84,

    This is a subtle problem when working with Range objects. Using Range or Cell without a qualifying prefix, defaults to the ActiveSheet. Use the With ... With End statement to fully qualify your Range objects. See the code below...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-28-2008
    Posts
    10
    Quote Originally Posted by Leith Ross

    This is a subtle problem when working with Range objects. Using Range or Cell without a qualifying prefix, defaults to the ActiveSheet. Use the With ... With End statement to fully qualify your Range objects. See the code below...

    Sincerely,
    Leith Ross
    Thank you so much Leith,

    I have spent two days trying to figure this out. I knew it was some small qualifier like that but I didn't know the syntax, and couldn't find anything through searching. You are a lifesaver man!

+ 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