Sub aa()
Application.ScreenUpdating = False
MyPath = ActiveWorkbook.Path
Myname = Dir(MyPath & "\" & "*.xlsx")
AWbName = ActiveWorkbook.Name
Num = 0
Do While Myname <> ""
If Myname <> AWbName Then
Set Wb = Workbooks.Open(MyPath & "\" & Myname)
Wb.Sheets(1).Cells(1, 2) = "=rand()" '双引号里换成你的公式,sheets(1).cells(1,2)换成你的单元格
Wb.Close False
End If
Myname = Dir
Loop
Application.ScreenUpdating = True
End Sub