Replace Data depending on file date

MHamid

Active Member
Joined
Jan 31, 2013
Messages
472
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

Is it possible to create a vba code that will replace data in some columns depending on the date in the file name?

For instance, I have a file name "YYYY_AA_BCDE_YYYY_MM_DD_v#.#_(Mar_Final)".In the first sheet, I have a date in column O. If the file name is (Mar_Final), then if the date in column O is after March, replace that date with N/A and go to column M of the same row and replace any data in that row to N/A.
Original Data:
Column M Column O
Dummy Data 04/04/2018
If File name is Mar_Final
Column M Column O
N/A N/A

The second sheet within the same file has a date in column D. If the date, is after the date in the file name (Mar_Final), then I need the word "Completed" in column C to be changed to "In Progress" and I need any data in columns D, E, F to be cleared within the same row.

Is it possible to do this with VBA code? I'm looking for two different VBA codes for each circumstance.

Thank you
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

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