i’m trying to fill a cell in excel with a Y or N if a file exists.. i think i need a macro because i’m not sure a formula will work. If my files name is \xyzmedia\08242018abcapp\wyoming\archive and would be in cell C10; what code can i use to fill a specific excel cell with a Y or N? in this particular instance, let’s say cell D10. i’ll be doing this for about 8 files per day, so that’s 8 cells that need to be updated. ideally, i’d want them all updated via the same macro.
if i could also have a “Search Files” button embedded on the worksheet to run the macro, that would be AMAZING.
the dates change everyday, so i’m guessing i’d have to change the dates in the 5 macros manually each week, which is fine. but is there a workaround? again, if not, completely ok.
I have NO clue what i’m doing as i’m very new to macros .. but after doing some research, maybe the code would be something like this?? (Check if the file exists using VBA):
Sub test()
thesentence = InputBox("\\xyzmedia\08242018abcapp\wyoming\archive", "Raw Data File")
Range("A1").Value = thesentence
If Dir("thesentence") <> "" Then
D10 = "Y"
Else
D10 = "N"
End If
End Sub
please help! thank you!!