wie kann ich in Spalte 3 und Spalte 15 den gesamten Zelleninhalt löschen, wenn dieser mit \\52023tk\ am Anfang beginnt?
Besten Dank im Voraus.
Viele Grüße,
Selma
Sub ttt()
Dim i As Long, rngDel As Range
Application.ScreenUpdating = False
For i = 1 To Cells(1, 1).CurrentRegion.Rows.Count
If Cells(i, 3) Like "\\52023tk\*" Then
If rngDel Is Nothing Then
Set rngDel = clls(i, 3)
Else
Set rngDel = Union(Cells(i, 3), rngDel)
End If
End If
If Cells(i, 15) Like "\\52023tk\*" Then
If rngDel Is Nothing Then
Set rngDel = clls(i, 15)
Else
Set rngDel = Union(Cells(i, 15), rngDel)
End If
End If
Next
If Not rngDel Is Nothing Then rngDel.ClearContents
Application.ScreenUpdating = True
End Sub
Sub ttt()
Dim i As Long, rngDel As Range
Application.ScreenUpdating = False
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 3) Like "\\52023tk\*" Then
If rngDel Is Nothing Then
Set rngDel = clls(i, 3)
Else
Set rngDel = Union(Cells(i, 3), rngDel)
End If
End If
If Cells(i, 15) Like "\\52023tk\*" Then
If rngDel Is Nothing Then
Set rngDel = clls(i, 15)
Else
Set rngDel = Union(Cells(i, 15), rngDel)
End If
End If
Next
If Not rngDel Is Nothing Then rngDel.ClearContents
Application.ScreenUpdating = True
End Sub