|
本帖最后由 qiaodong64 于 2017-1-12 12:17 编辑
Sub test() Dim mypath, myfile
mypath = ThisWorkbook.Path & "\"
myfile = Dir(mypath & "*.xlsx")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Do While myfile <> ""
If myfile <> ThisWorkbook.Name Then
Workbooks.Open mypath & myfile
With ActiveWorkbook_
Dim i As Integer
For i = 3 To 1000
If Val(Cells(i, 19)) > 100 Then
Value = "100"
Exit For
End If
Next
End With
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
myfile = Dir
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
本帖最后由 望帝春心 于 2017-1-12 12:51 编辑
- Sub test()
- Dim mypath, myfile
- mypath = ThisWorkbook.Path & ""
- myfile = Dir(mypath & "*.xlsx")
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Do While myfile <> ""
- If myfile <> ThisWorkbook.Name Then
- Workbooks.Open mypath & myfile
- With ActiveWorkbook_
- Dim i As Integer
- For i = 3 To 1000
- If Val(Cells(i, 19)) > 100 Then
- Cells(i, 19) = 100
- End If
- Next
- End With
- ActiveWorkbook.Save
- ActiveWorkbook.Close
- End If
- myfile = Dir
- Loop
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|