ich habe folgenden Code:
With ThisWorkbook.Worksheets(strHHSt)
inty = 1
'freie Spalte suchen
Do Until .Cells(inty, 1) = ""
inty = inty + 1
Loop
.Cells(inty, 1) = inty - 1
.Cells(inty, 2) = cboSachbearbeiter
.Cells(inty, 3) = cboHHSt
.Cells(inty, 4) = txtGemeinde
.Cells(inty, 5) = txtPatron
.Cells(inty, 6) = Format$(txtDatum, "dd mm yyyy")
.Cells(inty, 7) = txtBeschreibung
.Cells(inty, 8) = CDbl(txtGesamtBew)
.Cells(inty, 9) = CDbl(txtEtat)
.Cells(inty, 11) = CDbl(txtFreieMittel)
.Cells(inty, 12) = CDbl(txtVerfMittel)
.Cells(inty, 13) = CDbl(txtDenkmal)
.Cells(inty, 15) = CDbl(txtBonifatius)
'Summierung der Zwischensummen
.Cells(inty, 10) = Application.WorksheetFunction.Sum(Range("I2:I" & CStr(inty)))
.Cells(inty, 14) = Application.WorksheetFunction.Sum(Range("L2:m" & CStr(inty)))
.Cells(inty, 16) = Application.WorksheetFunction.Sum(Range("O2:O" & CStr(inty)))
intx = inty + 1
Rows(CStr(intx) & ":" & CStr(intx)).Select
Selection.Insert Shift:=xlDown
End With
Durch den letzten Teil soll erreicht werden, dass nach Eingabe iene Zeile eingefügt wird. Das klappt auch soweit, allerdings fügt er die Zeile immer nur im ersten Sheet ein, auch wenn die Variable strHHSt in "ThisWorkbook.Worksheets(strHHSt)" auf ein anderes Sheet verweist.
Woran kann das liegen?
Danke schon einmal
Björn