Sheets("MASTER").Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Range("A1").Select
ActiveCell.FormulaR1C1 = "Rank" & Chr(10) & "NEU"
With ActiveCell.Characters(Start:=1, Length:=8).Font
.Name = "Arial"
.FontStyle = "Standard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Cells.Select
Range("A2").Activate
Sheets("DETAILS").Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Columns("D:D").Select
Selection.Delete Shift:=xlToLeft
Sheets("MASTER").Select
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Range("A2").Select
Sheets("DETAILS").Select
Range("A1").Select
ActiveCell.FormulaR1C1 = "Rank" & Chr(10) & "NEU"
With ActiveCell.Characters(Start:=1, Length:=8).Font
.Name = "Arial"
.FontStyle = "Standard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
' ETWA HIER SOLLTE DER TEIL DANN VON DEM ZWEITEM CODE REIN
Range("A2").Select
ActiveCell.FormulaR1C1 = "=MATCH(MASTER!RC[2],[quelle.xls]Sheet1!C2,0)"
ActiveCell.FormulaR1C1 = "=MATCH(MASTER!RC[2],[quelle.xls]Sheet1!C2,0)-1"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A11"), Type:=xlFillDefault
Range("A2:A11").Select
Range("A1").Select
Sheets("MASTER").Select
ActiveCell.FormulaR1C1 = "=MATCH(RC[2],[quelle.xls]Sheet1!C2,0)"
ActiveCell.FormulaR1C1 = "=MATCH(RC[2],[quelle.xls]Sheet1!C2,0)-1"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A11"), Type:=xlFillDefault
Range("A2:A11").Select
Range("A1").Select
Sheets("DETAILS").Select
Range("A1:N11").Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
Sheets("MASTER").Select
Range("A1:H11").Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
Sheets("MASTER").Select
Sheets(1).Select
zahl = 1
Do While zahl < 12
zahl = zahl + 1
If Worksheets(1).Cells(zahl, 2).Interior.ColorIndex = 43 Then
Worksheets(1).Cells(zahl, 1).Interior.ColorIndex = 43
End If
If Worksheets(1).Cells(zahl, 2).Interior.ColorIndex = 6 Then
Worksheets(1).Cells(zahl, 1).Interior.ColorIndex = 6
End If
If Worksheets(1).Cells(zahl, 2).Interior.ColorIndex = 34 Then
Worksheets(1).Cells(zahl, 1).Interior.ColorIndex = 34
End If
If Worksheets(1).Cells(zahl, 2).Interior.ColorIndex = 54 Then
If Worksheets(1).Cells(zahl, 3).Interior.ColorIndex = 43 Then
Worksheets(1).Cells(zahl, 1).Interior.ColorIndex = 43
End If
If Worksheets(1).Cells(zahl, 3).Interior.ColorIndex = 6 Then
Worksheets(1).Cells(zahl, 1).Interior.ColorIndex = 6
End If
If Worksheets(1).Cells(zahl, 3).Interior.ColorIndex = 34 Then
Worksheets(1).Cells(zahl, 1).Interior.ColorIndex = 34
End If
End If
Loop
Sheets(2).Select
zahl = 1
Do While zahl < 12
zahl = zahl + 1
If Worksheets(2).Cells(zahl, 2).Interior.ColorIndex = 43 Then
Worksheets(2).Cells(zahl, 1).Interior.ColorIndex = 43
End If
If Worksheets(2).Cells(zahl, 2).Interior.ColorIndex = 6 Then
Worksheets(2).Cells(zahl, 1).Interior.ColorIndex = 6
End If
If Worksheets(2).Cells(zahl, 2).Interior.ColorIndex = 34 Then
Worksheets(2).Cells(zahl, 1).Interior.ColorIndex = 34
End If
If Worksheets(2).Cells(zahl, 2).Interior.ColorIndex = 54 Then
If Worksheets(2).Cells(zahl, 3).Interior.ColorIndex = 43 Then
Worksheets(2).Cells(zahl, 1).Interior.ColorIndex = 43
End If
If Worksheets(2).Cells(zahl, 3).Interior.ColorIndex = 6 Then
Worksheets(2).Cells(zahl, 1).Interior.ColorIndex = 6
End If
If Worksheets(2).Cells(zahl, 3).Interior.ColorIndex = 34 Then
Worksheets(2).Cells(zahl, 1).Interior.ColorIndex = 34
End If
End If
Loop
Sheets(1).Select
Range("A1:A11").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
Sheets("DETAILS").Select
Range("A1:A11").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
Sheets("MASTER").SelectCount = 1
Do While zahl < 12
Count = Count + 1
cound = 2
Do While cound < 12
If Windows("quelle.xls").cell(Count, 2) <> Windows("ziel.xls").cell(cound, 2) Then
If cound = 11 Then
Sheets("DETAILS").Select
Rows("13:13").Select
Selection.Insert Shift:=xlDown
Sheets("MASTER").Select
Rows("13:13").Select
Selection.Insert Shift:=xlDown
Else
cound = cound + 1
End If
Else
'KOPIEREN DER ZELLEN IN DIE PASSENDEN NEUEN ZELLEN VON QUELLE IN ZIEL- DATEI (MASTER+ DETAILS)' DIESER PART MÜSSTE NOCH UMGESETZT WERDEN! ABER DA HABE ICH KEINE AHNUNG!
End If
Loop
LoopSub Makro1()
Windows("quelle.xls").Activate
Rows("1:11").Select
Selection.Copy
Windows("ziel.xls").Activate
Range("A15").Select
ActiveSheet.Paste
Range("O16").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""N"""
Selection.FormatConditions(1).Interior.ColorIndex = 3
Range("O16").Select
Selection.Copy
Range("O16:O25").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
For i = 16 To 25
If Range("C" & i).Value = "Powerseller" Then
Range("A" & i & ":R" & i).Select
Selection.Interior.ColorIndex = 43
Else
If Range("C" & i).Value = "Profi" Then
Range("A" & i & ":R" & i).Select
Selection.Interior.ColorIndex = 6
Else
If Range("C" & i).Value = "Seller" Then
Range("A" & i & ":R" & i).Select
Selection.Interior.ColorIndex = 34
End If
End If
End If
Next i
Range("B15:B25").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Range("D15:E25").Select
Selection.Delete Shift:=xlToLeft
Range("F15:L25").Select
Selection.Delete Shift:=xlToLeft
Range("G15:G25").Select
Selection.Insert Shift:=xlToRight
For i = 16 To 25
Range("G" & i).Value = Date - Range("J" & i).Value
Next i
Range("G16:G25").Select
Selection.NumberFormat = "yy"
Range("I15:K25").Select
Selection.Delete Shift:=xlToLeft
Range("I19").Select
For i = 16 To 25
For j = 2 To 11
If Range("C" & i).Value = Range("C" & j).Value Then Range("B" & i).Value = Range("A" & j)
Next j
Next i
Range("A1").Select
Range("A1").Cut Destination:=Range("B1")
Rows("2:15").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
ActiveCell.FormulaR1C1 = "Rank"
Range("A1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
End Sub
Verschieben von Zeilen in Blätter mit Namensprinzip
XpressMe 30.11.2007 - 57 Hits - 3 Antworten
autom.Verschieben von Zeilen in ein anderes Tabellenblatt
Dude147 15.01.2008 - 23 Hits - 2 Antworten
VBA-Makro in Excel nur in gefilterten Zeilen ausführen
andreas_3 15.06.2008 - 85 Hits - 1 Antwort
VBA-Makro in Excel nur in gefilterten Zeilen ausführen
andreas_3 18.06.2008 - 60 Hits - 7 Antworten
Excel Zeilen verschieben
tfrommer 12.06.2008 - 65 Hits - 3 Antworten