Closed Thread
Results 1 to 3 of 3

Macro To Insert Formula

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Macro To Insert Formula

    I have this nasty formula:

    =SUMPRODUCT(('T-RECS'!$D$2:$D$5000-DAY('T-RECS'!$D$2:$D$5000)+1=DATE(YEAR('CENTRAL DIVISION-2007'!K$14),MONTH('CENTRAL DIVISION-2007'!K$14),1))*('CENTRAL DIVISION-2007'!$A15='T-RECS'!$A$2:$A$5000)*('T-RECS'!$C$2:$C$5000)).

    I have been using ctrl c and v and d to copy and paste and fill this formula down where I need it. But I was hoping a macro could do it for me. The trick is that I need it in certain columns. The rows never change.
    for example I need the fomula in rows 15-30, 50-63, 82-95, etc. and in Col. K this time. But next time I need it in Col M.,same rows. So, I was hoping for a macro that would ask me what column I need it in, and then automatically enter it in the rows I need. There are many rows so I would want to pre set those in the code, and only have to choose the column each time. Also, the formula would have to keep its references correct. So, if I choose col. M to paste in then I would need the formula to reference m$14 for the date. Like wise if one of the cells was M50, I would need the formula ref to be $A50.
    This macro would be an amazing time saver.

    Thank you very much for your time and help.

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Try something like this:
    Please Login or Register  to view this content.
    UnTested!
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Contributor
    Join Date
    12-12-2006
    Location
    New Zealand
    Posts
    151
    Note: Cross Posted

Closed 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