Zeiel hinzufügen wo ist der Fehler?
29.09.2006 21:43:30
Heiko
Hallo bei diesme Makro wird immer eine Zeiel eingefügt und jetzt solen die Werte der wks09 immer in die letzte hinzugefügte Tabelle eingetragenwerden! Wie geht das?
Sub Schaltfläche723_BeiKlick()
Dim wks09 As Worksheet
Dim wksDruck As Worksheet
Dim LZ As Long
Set wks09 = Worksheets("Tabelle1")
LZ = wks09.Cells(Rows.Count, 1).End(xlUp).Row - 1
Set wksDruck = Worksheets("Auswertung")
'Sheets("Druckauftrag").Visible = True
wksDruck.Activate
Cells.Find(What:="x", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Selection.EntireRow.Insert
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Font.ColorIndex = 5
ActiveCell.Select
ActiveCell.FormulaR1C1 = "=R[-1]C+1"
ActiveCell.Range("A1:I1").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(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
ActiveCell.Offset(0, 5).Range("A1").Select
ActiveCell.Offset(1, -5).Range("A1").Select
wksDruck.Cells(7, 3) = wks09.Cells(60, 2)
wksDruck.Cells(7, 4) = wks09.Cells(60, 4)
wksDruck.Cells(7, 5) = wks09.Cells(60, 5)
wksDruck.Cells(7, 6) = wks09.Cells(60, 6)
End Sub