I have a macro that finds a folder and updates all Excel documents within in the same way, however I need it to ignore one but I can't make it happen.
Here's the macro:
Sub FileUpdate()
Application.AskToUpdateLinks = False
Application.ScreenUpdating = False
Application.Calculation = xlManual
FolderName = (Sheets("Filepaths").Range("c22"))
If Right(FolderName, 1) <> Application.PathSeparator Then FolderName = FolderName & Application.PathSeparator
Filename = Dir(FolderName & ".xlsx")
Do While Len(Filename)
With Workbooks.Open(FolderName & Filename)
Call SheetUpdate
End With
Filename = Dir
ActiveWorkbook.Close SaveChnges = True
Loop
Application.AskToUpdateLinks = True
Application.Calculation = xlAutomatic
End Sub
The files do all need to be in the same folder, so it's unfortunate that only one can't have this macro running through it.
For clarification in case, the filepath to the folder is in a sheet called 'Filepaths' and it calls another macro called 'SheetUpdate'.
I have tried using 'If Not' to kind of make it run backwards- so it updated all documents that didn't have the name of the file I wanted to avoid. I also tried using 'Case' in different variations, but that was more of an attempt of putting other things together that I had seen work.
I'm very beginner to this and I've done a lot of searching for an answer, but i'm struggling for this specific one.