wie kann ich per VBA die letzte Zeile in der Spalte P ermitteln die den Wert "x" enthält?
Vielen Dank schon mal.
Gruß,
Jakob
Sub suchen()
Range("P65536").Select
Selection.End(xlUp).Select
Do Until ActiveCell = "x"
ActiveCell.Offset(-1, 0).Range("A1").Select
Loop
End Sub
Gruss Serge
Sub FindP()
Dim lRow As Long
For i = 1 To Cells(Rows.Count, 16).End(xlUp).Row
If Cells(i, 16) = "x" Then
lRow = i
End If
Next i
MsgBox "Letzes X in Zeile: " & lRow
End Sub
Gruss Rainer
Sub tt()
Dim iMax As Long, i As Long
For i = Cells(Rows.Count, 16).End(xlUp).Row To 1 Step -1
If Cells(i, 16) = "x" Then
iMax = i
Exit For
End If
Next
MsgBox iMax
End Sub
Gruß
Rudi
VBA-Code: |
Sub LetzesXinSpalteP() MsgBox Evaluate("=LOOKUP(2,1/(P1:P65535=""X""),ROW(P:P))") End Sub Gruss Jürgen |