+ Reply to Thread
Results 1 to 13 of 13

Macro to drag formula and paste values

  1. #1
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Lightbulb Macro to drag formula and paste values

    EDIT 3rd AUGUST:
    Bumping up.

    In a nutshell:

    1) the row number 3 would have the formula column (A3:BU3)
    2) macro would drag the formula down up to row 1000 (columns "A3:BU3" from row 4 to 1000)
    3) macro would copy and past values from row 4 to 1000 (columns "A3:BU3"), keeping original formula in row 3

    Thank you!!



    Hi guys,

    Once again need your expertise, any help would be appreciated.

    The formula below is slowing down the spreadsheet and looking for a macro that could:

    1) the only cell that would keep the formula would be the first cell in the row 2 (column "i")
    2) macro would drag the formula down up to row 1000 (column "i" from row 3 to 1000)
    3) macro would copy and past values from row 3 to 1000 (column "i"), keeping original formula on row 2

    Please Login or Register  to view this content.
    That would fix the issue.

    Thanks everyone,

    Rick
    Last edited by ricdamiani; 08-03-2016 at 06:28 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Hi ricdamiani,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Quote Originally Posted by Trebor76 View Post
    Hi ricdamiani,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    Hi Robert and AlphaFrog,

    Both macros are working, thank you very much!

    Regards,

    Rick

  5. #5
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Hi guys,

    The spreadsheet has changed a bit, and instead of auto filling only column I (auto fill from cell I3 to I1000, based on the formula in I2... after copying and pasting values of I3 to I1000, as per macro above), it needs now to be all cells on row 3, from column A to BU (so that's A3:BU3), autofill up to row 1000, and copy and paste values from row 4 to row 1000.

    Tried to do my self but didn't work, would appreciate if you guys could help me on that.

    Thanks,

    Rick

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    =IFERROR((
    VLOOKUP(A2,Sales!$B:$AR,MATCH(CONCATENATE($O$1,"/",$P$1),Sales!$3:$3,0)-1,0)+
    VLOOKUP(A2,Sales!$B:$AR,MATCH(CONCATENATE($O$1,"/",$P$1),Sales!$3:$3,0)-2,0)+
    VLOOKUP(A2,Sales!$B:$AR,MATCH(CONCATENATE($O$1,"/",$P$1),Sales!$3:$3,0)-3,0)+
    VLOOKUP(A2,Sales!$B:$AR,MATCH(CONCATENATE($O$1,"/",$P$1),Sales!$3:$3,0)-4,0))/4+(
    SUMIFS(Blending!$E:$E,Blending!$A:$A,A2,Blending!$J:$J,$Q$1)*-1+
    SUMIFS(Blending!$E:$E,Blending!$A:$A,A2,Blending!$J:$J,$R$1)*-1+
    SUMIFS(Blending!$E:$E,Blending!$A:$A,A2,Blending!$J:$J,$S$1)*-1+
    SUMIFS(Blending!$E:$E,Blending!$A:$A,A2,Blending!$J:$J,$T$1)*-1)/4,"")
    1. Instead of a macro, try adjusting those ranges - instead of full-column ranges, use only the range you need
    2. use helper columns to do some of the heavy lifting/repeated functions
    Instead of all those concat's (at least 4?) put this in a helper cell...=$O$1&"/"&$P$1 then just reference that cell
    in fact, that whole section...MATCH(CONCATENATE($O$1,"/",$P$1),Sales!$3:$3,0) can be put in 1 cell and referenced
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    =FDibbins;4447211
    1. Instead of a macro, try adjusting those ranges
    That's a good idea FDibbins, thanks for that, but actually as you can see in my previous post the spreadsheet has changed and now I have a lot of columns (A to BU) and macro would be the only solution.

    But I will do adjust my formula with your tips.

    Hope someone can help me with an amended macro.

    Thanks,

    Rick

  8. #8
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Bumping up.

    In a nutshell:

    1) the row number 3 would have the formula column (A3:BU3)
    2) macro would drag the formula down up to row 1000 (columns "A3:BU3" from row 4 to 1000)
    3) macro would copy and past values from row 4 to 1000 (columns "A3:BU3"), keeping original formula in row 3

    Thanks

    Rick

  9. #9
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Bumping up, please help.

  10. #10
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to drag formula and paste values

    Hi guys,

    Anyone there that could guide me?

    Thanks,

    Rick

  11. #11
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Formula slowing down spreadsheet. Macro to drag formula and paste values

    Quote Originally Posted by ricdamiani View Post
    Bumping up.

    In a nutshell:

    1) the row number 3 would have the formula column (A3:BU3)
    2) macro would drag the formula down up to row 1000 (columns "A3:BU3" from row 4 to 1000)
    3) macro would copy and past values from row 4 to 1000 (columns "A3:BU3"), keeping original formula in row 3

    Thanks

    Rick
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to drag formula and paste values

    Thanks AlphaFrog, it's working.

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Macro to drag formula and paste values

    Please wait at least a day before bumping your thread

+ 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. Drag Paste a formula in reverse.
    By cng in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-20-2016, 05:09 AM
  2. Paste Special drastically slowing down macro?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-17-2015, 02:20 PM
  3. Formula will not drag down or work with copy/paste
    By Victoria G in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-09-2015, 07:36 AM
  4. Macro to paste values over formula
    By kweejibo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-21-2014, 03:22 PM
  5. Replies: 6
    Last Post: 04-04-2013, 02:02 PM
  6. Replies: 2
    Last Post: 05-07-2012, 05:36 AM
  7. How to drag/paste formula on looong spreadsheet.
    By mud_shark in forum Excel General
    Replies: 3
    Last Post: 01-15-2010, 02:00 AM

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