Hello,
I started to program VBA with excel.
I have a list with ~166000 lines and 12 columns.
I want to find the Name Willi in the 4th column and only in the 4th column. If it is found, it should be cutted and pasted in a different sheet. Should it exist in another column it doesn't interest.
Until now the following program
-------------------------------------------------------------------------------------
Sub Willi()
'
' Willi Makro
'
'
Dim I As Integer
I = 1
Do
Cells.Find(What:="Willi", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Cut
Sheets("Endergebnis").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Haupttabelle").Select
I = I + 1
Loop While ActiveCell.Rows("1:1").EntireRow.Select <> "Falsch"
MsgBox I
End Sub
-------------------------------------------------------------------------------------
finds all "Willi" in each column and ends with
Runtime error '91'
Objectvariable or with-variable not set
It would be very kindly if somebody would show me my mistakes. I'm not experienced enough to find them myself.
Thanks and best regards
Willi
Bookmarks