+ Reply to Thread
Results 1 to 8 of 8

VBA to copy a formula from a cell range and paste it to a cell range based on date

  1. #1
    Forum Contributor
    Join Date
    03-22-2016
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    124

    Question VBA to copy a formula from a cell range and paste it to a cell range based on date

    Hi All,

    I hope you can help me come up with a VBA code wherein it copies a formula from a cell range and paste it to a cell range based on current date that matches in column A where dates are located. The copy function should be similar to a default copy past in excel were it adopts when you drag down a certain formula. Thanks.

    Please see my file attached.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by dedark05; 12-19-2019 at 04:37 AM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor tax112's Avatar
    Join Date
    02-28-2013
    Location
    Thailand
    MS-Off Ver
    Excel 2016 | 2019
    Posts
    438

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    Try:
    HTML Code: 
    Last edited by AliGW; 12-19-2019 at 03:43 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Forum Contributor
    Join Date
    03-22-2016
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    124

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    Quote Originally Posted by karedog View Post
    Maybe :
    Please Login or Register  to view this content.
    Yes! This is exactly what I mean and wanted to happen. But what I really need in my final excel is instead of paste referencing it to today, I would like to past it on the previous week instead. It should still look for the current date as the previous week will be based on the current day.

    Please see attached file sample
    Attached Files Attached Files
    Last edited by dedark05; 12-19-2019 at 04:00 AM.

  5. #5
    Forum Contributor
    Join Date
    03-22-2016
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    124

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    Quote Originally Posted by tax112 View Post
    Try:
    HTML Code: 
    this paste the formula to the future dates also. Not really what I meant. Sorry if I wasn't clear.
    Last edited by dedark05; 12-19-2019 at 04:00 AM.

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    Should be :
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-22-2016
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    124

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    Quote Originally Posted by karedog View Post
    Should be :
    Please Login or Register  to view this content.
    Thank you very much! It worked. I really appreciate your help.

  8. #8
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA to copy a formula from a cell range and paste it to a cell range based on date

    You are welcome, thanks for marking the thread as solved and rep.points.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy a cell range and paste it to a cell based on date
    By dedark05 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2019, 08:41 PM
  2. [SOLVED] VB Code to copy and paste range to certain sheet based on cell Value
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2019, 03:38 PM
  3. [SOLVED] Copy Paste a Range of Values from a Different Sheet Based on Value Entered in Cell
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-13-2015, 04:53 PM
  4. Copy and Paste a range based on a cell value that is not static
    By JmundleBofA in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-10-2014, 03:25 PM
  5. Macro to copy and paste range based on cell value
    By msls09 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-05-2013, 12:57 AM
  6. VBA code to copy and paste range based on separate cell value
    By Mhofu in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-01-2012, 03:03 PM
  7. Replies: 8
    Last Post: 03-01-2012, 02:44 PM

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