Excel // VBA // Code need to convert formula results to the results after a certain date

Evremonde

New Member
Joined
Sep 29, 2016
Messages
25
Hello All:

I have a spreadsheet that performs countif functions in cells D4 to D46 (data on another tab). Cell D1 contains a date. I need some VBA code that will convert the countif results (cells D4 to D46) to values and to do this on the date contained in cell D1. I need to perform this same routine in cells E4 to E46. Cell E1 contains the date. Again, I need to perform this same routine for the same cell patterns through column S. Can you assist...?
 
The formulas produce dates that are formatted as dates. Short dates i.e. 10/11/16... Formula in cell D1 is =C1. Formula in cell E2 is =D1+7...
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
But does the formula produce Excel dates?
If it's the case then the formatting ie. short date format, shouldn't affect the code.

What is in C1 (the source)?
 
Upvote 0
The source is a cell in another tab in the same worksheet. That cell is formatted is a short date as well. All cells are formatted as short dates. I assume this means an "Excel date". I start with cell C3 that contains =today(). In C2 I can (if necessary) enter a number e.g. 5. Cell C1 contains =C3+C2. This allows me to artificially produce a future date in cell C1. C1 is the source cell we speak of...
 
Upvote 0
The formulas produce dates that are formatted as dates. Short dates i.e. 10/11/16... Formula in cell D1 is =C1. Formula in cell E2 is =D1+7...
I'm a little confused with your formula in post #11: E2 is =D1+7. Should it be E1 is =D1+7?

Either way I have tried to reproduce your issue, but the code works no matter what I do by changing D4:D46 unless I put a positive value in C2, of course then it shouldn't work since all the dates are after todays date.
So if you are experiencing something else, I don't exactly know what your issue is...

Do you perhaps expect another outcome from the code?
 
Upvote 0
BQ:

I kept working with this. In another spreadsheet it works fine. Not sure what is going on in the first but thank you so very much...
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,277
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top