AW: Textboxinhalt suchen und zeile löschen
15.08.2014 23:31:33
Spenski
Hallo Tom , danke für die antwort , habs jetzt so gemacht da ich nix anderes gefunden hatte und den code in meinem archive entdeckt habe:
werde aber morgen gerne deinen probieren , sieht etwas schlanker aus^^
Option Explicit
Private Sub CommandButton1_Click()
Sheets(2).Unprotect
Dim lloRow As Long, liCounter As Integer
Dim x As Long, y As Long, rowl As Long, rowl1 As Long
Dim wkscont As Worksheet, wksx As Worksheet
Set wkscont = ActiveWorkbook.Worksheets(1)
With wkscont
rowl1 = ActiveWorkbook.Worksheets(2).Cells(Rows.Count, 1).End(xlUp).Row
For y = 1 To rowl1
Set wksx = ActiveWorkbook.Worksheets(2)
If IsNumeric(Application.Match(wksx.Cells(y, 2), .Range(.Cells(1, 17), .Cells(1, 17)), 0)) _
Then
liCounter = liCounter + 1
wksx.Rows(y).Delete
End If
Next y
End With
Sheets(2).Protect
MsgBox "FAUF" & " " & TextBox1.Value & " " & "wurde gelöscht"
Sheets(1).Range("Q1") = ""
End Sub
die Textbox habe ich dann mit Q1 verknüpft
gruss