Col A has dates and Col B has values
Every day new data added to bottom row.
Want VBA to copy the most recent 50 rows to C1:C50, D1:D50
Col A has dates and Col B has values
Every day new data added to bottom row.
Want VBA to copy the most recent 50 rows to C1:C50, D1:D50
A couple of formulas would also fill in the data automatically. The formula to populate column C with the most recent 50 dates could be:The formula to populate column D with the most recent 50 values could be:Formula:
Please Login or Register to view this content.Let us know if you have any questions.Formula:
Please Login or Register to view this content.
Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.
You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.
Try this for the date (C1 and down):And this for the value (D1 and down):Formula:
Please Login or Register to view this content.Formula:
Please Login or Register to view this content.
Let us know if you have any questions.
Last edited by JeteMc; 01-26-2017 at 07:11 PM. Reason: Added second formula
I forgot to account for holidays, so:Formula:
Please Login or Register to view this content.Formula:
Please Login or Register to view this content.
In that event I would think that it would be good to use the following formula to find the last date in column A:Then reference the cell containing that formula, N1 in the attached sample, inside the WORKDAY function of both formulas, as in:Formula:
Please Login or Register to view this content.You could put the LOOKUP function in the formula, in place of N1, however that seems to slow the process down a lot, I believe that is because the formula in each of the 50 cells in looking to see the the last non-blank cell out of the one million plus rows in column A. As it is that only has to happen once. I hope that makes sense.Formula:
Please Login or Register to view this content.
Let us know if you have any questions.
You're Welcome and I'm glad that you got a solution that works. I assume by "not important" that you have solved the holiday issue, and if so please take a moment to mark the thread as 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks