Gruppe
Allgemein
Problem
Ausgewählte Zellen sollen Zeile für Zeile horizontal verbunden werden.
StandardModule: Modul1
Sub Verbinden()
Dim iRow As Integer, iCol As Integer, iColL As Integer
If Selection.Columns.Count = 1 Then
Beep
MsgBox "Bitte mehr als eine Spalte auswählen!"
Exit Sub
End If
iCol = Selection.Column
iColL = Selection.Column + Selection.Columns.Count - 1
For iRow = Selection.Row To Selection.Row + Selection.Rows.Count - 1
Range(Cells(iRow, iCol), Cells(iRow, iColL)).Merge
Next iRow
End Sub