von gero018 » Fr, 16.10.2009 17:26
Hallo Rene
Hab mal Makro angehängt. Kann man das was machen?
Gruss
Dieter
'
' Makro GeräteGesamt
' Makro Geräte kopieren und sortieren
'
' Tastenkombination: Strg+g
'
Sheets("Geräte-Gesamt").Select
Cells.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Cells(1, 1).Value = ("Bezeichnung")
Cells(1, 2).Value = ("Lieferant")
Cells(1, 3).Value = ("Type")
Cells(1, 4).Value = ("LB-Nr.")
Cells(1, 5).Value = ("AB-Nr.")
Cells(1, 6).Value = ("Koje")
Dim Range1 As Range
Dim Range2 As Range
Dim Range3 As Range
Dim Range4 As Range
Dim Range5 As Range
Dim RangeGesamt As Range
For Blatt = 8 To Sheets.Count
Sheets(Blatt).Select
For Zeile = 1 To 11
Cells(Zeile + 7, 3).Select
If Selection <> "" Then
Set Range1 = Cells(Zeile + 7, 2)
Set Range2 = Cells(Zeile + 7, 3)
Set Range3 = Cells(Zeile + 7, 4)
Set Range4 = Cells(Zeile + 7, 6)
Set Range5 = Cells(Zeile + 7, 7)
Set RangeGesamt = Union(Range1, Range2, Range3, Range4, Range5)
RangeGesamt.Select
Selection.Copy
Sheets("Geräte-Gesamt").Select
Cells((Blatt - 6) * 11 + Zeile, 1).Select
ActiveSheet.Paste
Cells((Blatt - 6) * 11 + Zeile, 6).Value = Sheets(Blatt).Name
Sheets(Blatt).Select
Range("A1").Select
End If
Next Zeile
Sheets("Geräte-Gesamt").Select
Range("A1").Select
Next Blatt
Range("A1").Select
Cells.Select
Application.CutCopyMode = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Standard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Interior.ColorIndex = xlNone
Selection.Columns.AutoFit
Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Key3:=Range("C1"), Order3:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
Rows("1:1").Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range("A1").Select
End Sub
Hallo Rene
Hab mal Makro angehängt. Kann man das was machen?
Gruss
Dieter
'
' Makro GeräteGesamt
' Makro Geräte kopieren und sortieren
'
' Tastenkombination: Strg+g
'
Sheets("Geräte-Gesamt").Select
Cells.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Cells(1, 1).Value = ("Bezeichnung")
Cells(1, 2).Value = ("Lieferant")
Cells(1, 3).Value = ("Type")
Cells(1, 4).Value = ("LB-Nr.")
Cells(1, 5).Value = ("AB-Nr.")
Cells(1, 6).Value = ("Koje")
Dim Range1 As Range
Dim Range2 As Range
Dim Range3 As Range
Dim Range4 As Range
Dim Range5 As Range
Dim RangeGesamt As Range
For Blatt = 8 To Sheets.Count
Sheets(Blatt).Select
For Zeile = 1 To 11
Cells(Zeile + 7, 3).Select
If Selection <> "" Then
Set Range1 = Cells(Zeile + 7, 2)
Set Range2 = Cells(Zeile + 7, 3)
Set Range3 = Cells(Zeile + 7, 4)
Set Range4 = Cells(Zeile + 7, 6)
Set Range5 = Cells(Zeile + 7, 7)
Set RangeGesamt = Union(Range1, Range2, Range3, Range4, Range5)
RangeGesamt.Select
Selection.Copy
Sheets("Geräte-Gesamt").Select
Cells((Blatt - 6) * 11 + Zeile, 1).Select
ActiveSheet.Paste
Cells((Blatt - 6) * 11 + Zeile, 6).Value = Sheets(Blatt).Name
Sheets(Blatt).Select
Range("A1").Select
End If
Next Zeile
Sheets("Geräte-Gesamt").Select
Range("A1").Select
Next Blatt
Range("A1").Select
Cells.Select
Application.CutCopyMode = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Standard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Interior.ColorIndex = xlNone
Selection.Columns.AutoFit
Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Key3:=Range("C1"), Order3:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
Rows("1:1").Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range("A1").Select
End Sub