Gruppe
Allgemein
Problem
Es soll eine über InputBox abzufragende Spaltenzahl eingefügt werden. Die Startspalte wird im Code über eine Konstante festgelegt.
StandardModule: Modul1
Sub InsertColumns()
Const ciStart As Integer = 4
Dim vCount As Variant
vCount = Application.InputBox("Spaltenanzahl:", Type:=1)
If vCount = False Then Exit Sub
Range(Cells(1, ciStart), Cells(1, ciStart + vCount - 1)).EntireColumn.Insert
End Sub