+ Reply to Thread
Results 1 to 3 of 3

Relative cell reference in formula with vba

  1. #1
    Registered User
    Join Date
    10-24-2008
    Location
    france
    Posts
    53

    Relative cell reference in formula with vba

    Good Morning everybody,

    Here is my problem (Im a vba newbie!)

    Please Login or Register  to view this content.
    I have this code which essentially takes the formula from B6 and copies it in the next empty row.

    Cell B6 contains the following formula : =AND(E6>=StartDate;E6<=EndDate)

    However, when i run my macro, it copies the same formula from cell B6 without regards to the destination cell, which is relative as entries are made.

    For example, cell E43 will contain the =AND(E6>=StartDate;E6<=EndDate) instead of =AND(E43>=StartDate;E43<=EndDate)

    Could you guys help me figure out how to make it copie the formula but adjust it to the destination cell please? I am using excel 2000 and only a beginner at vba!

    thanks in advance
    Last edited by ramakavin; 02-16-2009 at 11:08 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Relative cell reference in formula with vba

    Maybe ...
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-24-2008
    Location
    france
    Posts
    53

    Re: Relative cell reference in formula with vba

    Hello SHG,

    As usual, u are the quickest to reply! I am sure your code works as i managed to generate something similar with the macro recorder. However, i am not managing to integrate it to my code. I followed a tutorial to create a userform and it uses the structure i posted above. i.e with the offset and row count.

    I duno how to modify this code to achieve what i am looking for. Maybe i will just post my excel file so you can have a clearer idea. Thank you very much for your help
    Attached Files Attached Files
    Last edited by ramakavin; 02-16-2009 at 11:48 AM. Reason: Attached file ;)

+ 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