1.7k Aufrufe
Gefragt in Anwendungen(Java,C++...) von
Hallo,

ich möchte gerne folgenden Makro (MS-Excel) erstellen:

Zunächst möchte ich mit Hilfe von 2 InputBoxen eine in Bezug auf Zeile und Spalte variable Zelle definieren in die die erste Variable übertragen werden soll.

Anschließend soll über eine weitere InputBox der Wert der ersten Variable eingegeben werden, der in die zuvor variabel definierte Zelle übertragen werden soll.

Über weitere Inputboxen sollen nun weitere Variablen eingegeben werden und in Zellen übertragen werden die in Abhängigkeit von der ersten Zelle positioniert werden sollen (vgl. Makro).


Bisher sieht der Makro so aus:

Sub Uebung4()
Rem Voreinstellung
Rem Sheets("Übungsblatt 4 (A2 - Makro)").Select
Dim z(200, 200) As Double

u = InputBox("Zeilenangabe Variable a", wert)
v = InputBox("Zeilenangabe Variable a", wert)

Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable a", wert)
Range(Cells(u, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable b", wert)
Range(Cells(u + 1, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable c", wert)
Range(Cells(u + 2, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable d", wert)
Range(Cells(u + 3, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable e", wert)
Range(Cells(u, v + 3)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable f", wert)
Range(Cells(u + 1, v + 3)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable g", wert)
Range(Cells(u + 2, v + 3)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Zahlenwert Variable h", wert)
Range(Cells(u + 3, v + 3)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Xmin Eingabe", wert)
Range(Cells(u + 5, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Xmax Eingabe", wert)
Range(Cells(u + 6, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("nX Eingabe", wert)
Range(Cells(u + 7, v)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Ymin Eingabe", wert)
Range(Cells(u + 5, v + 3)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("Ymax Eingabe", wert)
Range(Cells(u + 6, v + 3)).Value = strInbox
Dim strInbox As String
strInbox = InputBox("nYEingabe", wert)
Range(Cells(u + 7, v + 3)).Value = strInbox

Rem Einlesen von Daten aus einer Zelle
a = Cells(u, v)
b = Cells(u + 1, v)
c = Cells(u + 2, v)
d = Cells(u + 3, v)
e = Cells(u, v + 3)
f = Cells(u + 1, v + 3)
g = Cells(u + 2, v + 3)
h = Cells(u + 3, v + 3)

Rem Intervallbreite festlegen
xmin = Cells(u + 5, v)
xmax = Cells(u + 6, v)
nx = Cells(u + 7, v)
ymin = Cells(u + 5, v + 3)
ymax = Cells(u + 6, v + 3)
ny = Cells(u + 7, v + 3)

1 Antwort

0 Punkte
Beantwortet von
ich möchte mich schonmal im Vorraus für Antworten bedanken.

Gruß Flo
...