Hallo,
ich habe folgenden Code.
ich frage dort im Tabllenblatt "Terminplan" die Zelle F6 ab
wie muss ich den Code verändern, dass ich diese Zelle in einem anderen Tabellenblatt
abfragen kann.
Danke im Voraus
Matthias
Sub Uebertrag_Montagefirma()
Dim loAnz As Long, loLetzte As Long
Dim raBereich As Range, raZelle As Range
Dim lngCalc As Long
Application.ScreenUpdating = False
lngCalc = Application.Calculation
Application.Calculation = xlCalculationManual
With Worksheets("Montagefirma")
.Range("A1:xfd" & .Cells(.Rows.Count, 1).End(xlUp).Row).Clear
End With
With Worksheets("Terminplan")
.Columns("A:B").Hidden = False
Set raBereich = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
For Each raZelle In raBereich.SpecialCells(xlCellTypeVisible)
If raZelle.Text = .Range("F6").Text Then
raZelle.EntireRow.SpecialCells(xlCellTypeVisible).Copy
loAnz = loAnz + 1
With Worksheets("Montagefirma")
loLetzte = .Cells(.Rows.Count, "A").End(xlUp).Offset(1).Row
If .Cells(1, "A") = "" Then loLetzte = 1
.Cells(loLetzte, "A").PasteSpecial Paste:=xlPasteValuesAndNumberFormats
.Cells(loLetzte, "A").PasteSpecial Paste:=xlPasteFormats
End With
End If
Application.CutCopyMode = False
Next raZelle
.Columns("A:B").Hidden = True
End With
Application.Calculation = lngCalc
MsgBox "Es wurden " & loAnz & " Sätze übertragen."
Set raBereich = Nothing
End Sub
|