Microsoft Office Tutorials and References
In Depth Information
Abbildung 13.32: Mehrfachoperation per VBA erstellen
Per VBA lässt sich die vollständige Tabelle inklusive Zeilen- und Spaltenkopf mit fol-
gendem Code erzeugen:
Sub MOP()
Dim SpalteVon As Double, SpalteBis As Double, spalten As Long
Dim ZeileVon As Double, ZeileBis As Double, zeilen As Long
Dim AdresseOutput As String, x As Long, rng As Range
1 Set rng = Range("MOP_Bereich")
2 zeilen = rng.Rows.Count
3 spalten = rng.Columns.Count
4 SpalteVon = 80
5 SpalteBis = 200
6 ZeileVon = 0.04
7 ZeileBis = 0.065
8 AdresseOutput = "B6"
9 rng.Cells(1, 1).Formula = "=" & AdresseOutput
10 For x = 2 To Zeilen 'Spaltenkriterium
11 rng.Cells(x, 1).Value = _
SpalteVon + (SpalteBis - SpalteVon) * (x-2) / (zeilen - 2)
12 Next
Search JabSto ::




Custom Search