Such-Schleife
09.04.2017 17:56:26
cH_rI_sI
ich hätte eine Frage - wie suche ich richtig, wenn die Anzahl des gesuchten Begriffs nicht bekannt ist? Es funktioniert weder dieser Code:
For temp_C = 1 To ActiveSheet.Cells.SpecialCells(xlLastCell).Column
For temp_R = 1 To ActiveSheet.Cells.SpecialCells(xlLastCell) _
.Row
strSuwort = "SQ"
If Cells(temp_R, temp_C).String = strSuwort Then
Cells(temp_R, temp_C).Select
Betreiber_C = ActiveCell.Column
Betreiber_R = ActiveCell.Row
End If
Next
Next
Noch dieser:For Betreiber_C = 1 To WS1.Cells.SpecialCells(xlLastCell).Column
For Betreiber_R = 1 To WS1.Cells.SpecialCells(xlLastCell). _
Row
strSuwort = "SQ*"
Betreiber = Cells.Find(What:=strSuwort, LookIn:= _
xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate
If Betreiber = True Then
Betreiber_C = ActiveCell.Column
Betreiber_R = ActiveCell.Row _
End If
Next
Next
Was mache ich falsch?Bitte um Eure Unterstützung - Danke!
Lg,
Chrisi