I am trying to change cells range in one hundred workbooks using an excel list as a reference to the file location and the data I want to adjust in each workbook.
File Name: File location
Date: the data I want to write in each file at cells range (F3:F5) in each file
I am using 2 VBA (those VBA ar from online not main)
Sub ReplaceDate(wkbName AsString, dt asstring)
Dim wkb As Workbook
Set wkb = Workbooks.Open(Filename:=wkbName)
.Sheets("JAN").Unprotect.Range("F3:F5").Value = dt
then I use the below to make the loob
Dim rg As Range, sngCell As Range
Set rg = Range("A2:B101")
ForEach sngCell In rg
but it gave me the blow Error
can someone advice where I went wwrong and how can I fix this ??