AW: bestimmten Zelleninhalt in Spalte S verschiebe
22.01.2008 17:02:33
Erich
Hallo Selma,
noch ne Möglichkeit:
Option Explicit
Sub Nicht_freigegeben_Sp20()
Dim strSuch As String, rngF As Range
strSuch = "nicht freigegeben"
With Intersect(ActiveSheet.UsedRange, _
Union(Range(Columns(1), Columns(19)), Range(Columns(21), Columns(Columns.Count))))
Set rngF = .Find(What:=strSuch, _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not rngF Is Nothing Then
Do
If IsEmpty(Cells(rngF.Row, 20)) Then
rngF.Copy Cells(rngF.Row, 20)
rngF.ClearContents
Else
rngF = "## " & strSuch
MsgBox "Zelle " & Cells(rngF.Row, 20).Address(0, 0) & " ist nicht leer!" _
& vbLf & rngF.Address(0, 0) & " wurde geändert." & vbLf & "Neuer Text:" _
& vbLf & vbLf & rngF, vbCritical, "Nicht_freigegeben_Sp20"
End If
Set rngF = .FindNext(rngF)
Loop While Not rngF Is Nothing
End If
End With
End Sub
Rückmeldung wäre nett! - Grüße von Erich aus Kamp-Lintfort