Code vervollständigen
26.03.2009 08:15:17
lanima
VBA eher sehr bescheiden,
ich habe mittels Recorder und testen folgenden Code zusammen gebastelt:
Sub Export()
Dim i As Long
Application.ScreenUpdating = False
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(i, 15) = "nicht beliefert" Then Rows(i).Delete
Next i
Cells.Select
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 0
Columns("D:D").Select
Selection.Delete
Columns("K:S").Select
Selection.Delete
Columns("L:M").Select
Selection.Delete
With Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)).Resize(, 11)
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
Application.ScreenUpdating = True
End Sub
Was mir jetzt noch fehlt ist eine fortlaufende Nummerierung in Spalte A von 1 - x bis zur letzten gefüllten Zeile,
und die Selektion auf Spalte L und M bleibt bestehen, wie kriege ich die weg.
Kann mir bitte jemand helfen
Vielen Dank schon mal für die Mühe.
Gruß
Martin