ich versuche eine Lösung für folgendes Problem zu finden.
Zwischen nicht leeren Spalten, die Anzahl der Spalten ist variabel, eine leere Spalte enfügen mit ColumnWidth = 3.14
Wie könnte man das realisieren?
Vielen Dank im Voraus. chandler
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |
3 | x | ||||||||||||||
4 | |||||||||||||||
5 | x | x | x | x | x | x | |||||||||
6 | |||||||||||||||
7 | |||||||||||||||
8 | x | ||||||||||||||
9 |
Sub insertEmpty()
Dim iCol
For iCol = 1 To Selection.Columns.Count - 1
If Application.CountA(Columns(Selection(iCol).Column)) And Application.CountA(Columns( _
Selection(iCol + 1).Column)) Then
Columns(Selection(iCol).Column + 1).Insert Shift:=xlToRight
Columns(Selection(iCol).Column + 1).ColumnWidth = 6.14
End If
Next
End Sub
Grüße