Option
Explicit
Public
Sub
xSpalteKontrollieren()
Rem die Werte aus Spalte F die Werte in Spalte E ersetzten
Rem wenn Spalte F leer ist, .....
Rem soll der alte wert in Spalte E nicht überschrieben werden
Const
eSp = 5
Const
fSp = 6
Const
fRow = 1
Dim
lRow
As
Long
Dim
x
As
Long
Application.ScreenUpdating =
Not
Application.ScreenUpdating
lRow = Cells.Find(
"*"
, [a1], , , xlByRows, xlPrevious).Row
For
x = fRow
To
lRow
If
Cells(x, fSp).Value <>
""
Then
_
Cells(x, eSp).Value = Cells(x, fSp).Value
Next
x
Application.ScreenUpdating =
Not
Application.ScreenUpdating
End
Sub
Rem oder
Public
Sub
cSpalteKontrollieren()
Rem die Werte aus Spalte F die Werte in Spalte E ersetzten
Rem wenn Spalte F leer ist, .....
Rem soll der alte wert in Spalte E nicht überschrieben werden
Const
eSp = -1
Const
fSp = 6
Dim
mRng
As
Range, c
As
Range
Application.ScreenUpdating =
Not
Application.ScreenUpdating
Set
c = Cells(Rows.Count, fSp)
Set
mRng = Columns(fSp).ColumnDifferences( _
Comparison:=Range(c.Address))
For
Each
c
In
mRng
c.Offset(0, eSp).Value = c.Value
Next
c
Application.ScreenUpdating =
Not
Application.ScreenUpdating
End
Sub
Rem diese Variate ist ca. 15 % schneller