Sprawdź Sub marie()
Dim Dukt As String, plik As String, i As Long, wiersz As Long, kolumna As Integer
Dim skoro As Object
Dukt = "C:\Documents and Settings\Admin\Moje dokumenty\Pobieranie\"
plik = Dir(Dukt & "*.xlsx")
Do
If plik = "" Then Exit Do
Set skoro = GetObject(Dukt & plik)
With skoro.Worksheets(1)
kolumna = .Cells.Find(What:="*", After:=Cells(1, 1), _
SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
wiersz = .Cells.Find(What:="*", After:=Cells(1, 1), _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If kolumna > 3 Then .Range(.Cells(1, 4), .Cells(Row, kolumna)).Clear
For i = wiersz To 1 Step -1
If .Cells(i, 1) = "" Then
.Rows(i).Delete
Else
.Cells(i, 3) = .Cells(i, 3) * 100
End If
Next i
.SaveAs Dukt & Replace(plik, "xlsx", "CSV"), FileFormat:=xlCSV
skoro.Close True
plik = Dir
End With
Loop
End Sub |