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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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