Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1064to1068
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Code vervollständigen

Code vervollständigen
26.03.2009 08:15:17
lanima
Hallo zusammen,
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

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Habs gefunden
26.03.2009 08:48:16
lanima
so:
For i = 2 To 100
If Application.WorksheetFunction.CountA(Range(Cells(i, 1), Cells(i, 1))) > 0 Then
Cells(i, 1) = i - 1
End If
Next i
Gruß
Martin

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige