raccoon588
Board Regular
- Joined
- Aug 5, 2016
- Messages
- 118
I have a calendar in excel populated with a years worth of dates. I would like to be able to check for a file based off of the date in the cell and then change the color of the cell based on if that file exists or not. I was able to create the following code but i am not sure how to get it to review ALL cells in one go. Right now i manually change the range. I'm stuck on have it automatically look at each cell and then change that cell based on finding the file. The bellow code works except it is going to be very cumbersome to write this line of code for every day in the calendar year. (the file location is just some sample files once i have it up and running all files will be saved in one location for an entire year)
Code:
Sub Find_File()Dim MyFile As String
MyFile = "\\hinas1\mfg\led\ssl paperwork\p552p558\july2017\p55xfirstarticle" & " " & Range("A12").Text & " " & "*.xlsm"
If Dir(MyFile) <> "" Then
Range("A12").Interior.ColorIndex = 10
Else
Range("A12").Interior.ColorIndex = 3
End If
End Sub