+ Reply to Thread
Results 1 to 1 of 1

Excel 2007 : Relative Cell References in VBA formula

  1. #1
    Registered User
    Join Date
    10-27-2011
    Location
    Huntsville, AL, USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question Relative Cell References in VBA formula

    I am new to VBA in Excel. Mostly I've just been dabbling in simple user-defined functions, and have been pretty successful up to this point. Now, I'm trying to set up a function that will return the number of months between two dates. One date is determined by a previous UDF, but the other is called out in column D of each row. I have named the range "POP_End", and that works as a relative reference when I use the formula directly in the spreadsheet. However, if I use it as a reference in my VB module, it seems to include the entire range, rather than the one cell that is relative to the cell where I enter the function. Here's my code:

    Please Login or Register  to view this content.
    Basically, I need it to select the value in the cell in range "POP_End" that is in the same row as the active cell.
    Last edited by pike; 10-28-2011 at 03:31 AM. Reason: add code tags for newbie PM rule

+ 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