Excel und VBA - Die Excel-FAQÜber InputBox zu ermittelnde Spaltenanzahl einfügen |
|
Produkte
Service
Sonstiges
|
Über InputBox zu ermittelnde Spaltenanzahl einfügenProblem: 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 |
||||||||||||||