Was fehlt, damit Aktion best. Sheet ...
27.02.2008 17:51:00
Peter
Liebes Forum
Was muss ich in untenstehendem Code noch anpassen, damit die gewünschte Aktion (Replace) im Sheet "CW" ausgeführt wird?
Danke für eine Rückmeldung.
Peter
Option Explicit
Sub worksheet_deactivate()
Application.StatusBar = ""
Dim i As Integer
Dim rng As Range
ThisWorkbook.Activate
With Application
For i = 1 To 26
If .CountIf(Sheets("CW").Columns(i), "*T.*") + .CountIf(Sheets("CW").Columns(i), "*C.*") _
> 0 Then
Set rng = Range(Sheets("CW").Cells(1, i), Sheets("CW").Cells(Cells(Rows.Count, i). _
End(xlUp).Row, i))
Exit For
End If
Next
End With
If Not rng Is Nothing Then rng.Replace What:=" ", Replacement:="", LookAt:=xlPart
End Sub