|
- Sub test()
- Dim pth As String, arr, i&, file As String, wb As Workbook
- Application.DisplayAlerts = False
- Application.ScreenUpdating = False
- pth = ThisWorkbook.Path & ""
- file = Dir(pth & "*.xls*")
- Do While file <> ""
- If file = ThisWorkbook.Name Then
- Set wb = ActiveWorkbook
- Else
- Set wb = Workbooks.Open(pth & file)
- End If
- With wb.Sheets(1)
- arr = .Range(.Cells(1, "v").End(4), .Cells(Rows.Count, "v").End(3))
- For i = 1 To UBound(arr)
- arr(i, 1) = arr(i, 1) * 1.1
- Next
- .Cells(1, "v").End(4).Resize(UBound(arr), 1) = arr
- End With
- If file <> ThisWorkbook.Name Then wb.Close True
- file = Dir
- Loop
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- Set wb = Nothing
- End Sub
复制代码 水一发 |
|