Trying to automate updates to multiple Excel files.
(I might be running into incorrect file path calls)
My code:
Sub UpdateFiles()
MyDir = Application.ThisWorkbook.Path
DataDir = MyDir & "\folder1\"
ChDir (DataDir)
Nextfile = Dir("*.xlsx")
While Nextfile <> ""
Workbooks.Open (Nextfile)
Workbooks(Nextfile).Sheets("sheet1").Range("F22") = "Major"
Workbooks(Nextfile).Save
Workbooks(Nextfile).Close
Nextfile = Dir()
Wend
End Sub
Would like data in cell F22, on sheet1, to read "Major"