Witam!
wypróbuj tego:
Sub DEL95HTMLemptyCells()
'David McRitchie, 2002-08-24, Worksheet Functions
' Move cells up into empty cell below if Column A cell
' on line to be moved up is empty.
Application.ScreenUpdating = False
Application.Calculation = xlManual '--Excel 95
Dim Rcnt As Long, Ccnt As Long, r As Long, c As Long
Dim CurrCell As Range
On Error Resume Next
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByColumns, MatchCase:=True
Rcnt = Cells.SpecialCells(xlLastCell).Row
Ccnt = Cells.SpecialCells(xlLastCell).Column
For r = Rcnt To 2 Step -1
If IsEmpty(Cells(Rcnt, 1)) Then
For c = 1 To Ccnt
If Not IsEmpty(Cells(r, c)) Then
If Not IsEmpty(Cells(r - 1, c)) Then GoTo notthis
End If
Next c
For c = 1 To Ccnt
If Not IsEmpty(Cells(r, c)) Then
Cells(r - 1, c) = Cells(r, c)
End If
Next c
Cells(r, 1).EntireRow.Delete
notthis:
End If
Next r
Application.Calculation = xlAutomatic '--Excel 95
Application.ScreenUpdating = True
End Sub
z pozdrowieniami |