ich möchte alle Werte aus dem Bereich B1:B25, welche <>"" sind, in D4 eintragen. Die Namen sollen durch ein Komma getrennt sein. Kann mir jemand helfen?
Tschüß Micha
wie folgt...
Option ExplicitSub ZellenÜbertragen()
Dim i%
Application.ScreenUpdating = False
For i = 1 To 25
If Not IsEmpty(Cells(i, 2)) Then
Cells(4, 4) = Cells(4, 4) & "," & Cells(i, 2)
End If
Next i
Application.ScreenUpdating = True
End Sub
Ciao MikeS
Sub dvier()
Dim b As Range
For Each b In Range("B1:B25")
If b.Value <> "" Then
[d4] = [d4] & b.Value & ";"
End If
Next
If Len([d4]) > 0 Then
[d4] = Left([d4], Len([d4]) - 1)
End If
End Sub
gruß
Christian
sorry der Fehlerteufel.
So läuft's perfekt...
Sub ZellenÜbertragen() Ciao MikeS
Option Explicit
Dim i%
Application.ScreenUpdating = False
For i = 1 To 25
If Not IsEmpty(Cells(i, 2)) Then
If IsEmpty(Cells(4, 4)) Then
Cells(4, 4) = Cells(i, 2)
Else
Cells(4, 4) = Cells(4, 4) & ", " & Cells(i, 2)
End If
End If
Next i
Application.ScreenUpdating = True
End Sub
Code eingefügt mit Syntaxhighlighter 2.1