Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
344to348
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
344to348
344to348
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

In VBA: A1:G7 = 1 bis 49

In VBA: A1:G7 = 1 bis 49
04.12.2003 10:24:52
N. Davidheimann
Hallo,

wie muß die Codezeile aussehen um A1:G7 mit dem Zahlen von 1 bis 49 zu füllen ?

Viele Grüße
Norbert

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: In VBA: A1:G7 = 1 bis 49
04.12.2003 10:41:22
Klaus
Hallo Norbert,
geht auch bestimmt einfacher, aber funktioniert.


Sub füllen()
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
ActiveCell.FormulaR1C1 = "2"
Range("C1").Select
ActiveCell.FormulaR1C1 = "3"
Range("D1").Select
ActiveCell.FormulaR1C1 = "4"
Range("E1").Select
ActiveCell.FormulaR1C1 = "5"
Range("F1").Select
ActiveCell.FormulaR1C1 = "6"
Range("G1").Select
ActiveCell.FormulaR1C1 = "7"
Range("A2").Select
ActiveCell.FormulaR1C1 = "8"
Range("B2").Select
ActiveCell.FormulaR1C1 = "9"
Range("C2").Select
ActiveCell.FormulaR1C1 = "10"
Range("D2").Select
ActiveCell.FormulaR1C1 = "11"
Range("E2").Select
ActiveCell.FormulaR1C1 = "12"
Range("F2").Select
ActiveCell.FormulaR1C1 = "13"
Range("G2").Select
ActiveCell.FormulaR1C1 = "14"
Range("A3").Select
ActiveCell.FormulaR1C1 = "15"
Range("B3").Select
ActiveCell.FormulaR1C1 = "16"
Range("C3").Select
ActiveCell.FormulaR1C1 = "17"
Range("D3").Select
ActiveCell.FormulaR1C1 = "18"
Range("E3").Select
ActiveCell.FormulaR1C1 = "19"
Range("F3").Select
ActiveCell.FormulaR1C1 = "20"
Range("G3").Select
ActiveCell.FormulaR1C1 = "21"
Range("A4").Select
ActiveCell.FormulaR1C1 = "22"
Range("B4").Select
ActiveCell.FormulaR1C1 = "23"
Range("C4").Select
ActiveCell.FormulaR1C1 = "24"
Range("D4").Select
ActiveCell.FormulaR1C1 = "25"
Range("E4").Select
ActiveCell.FormulaR1C1 = "26"
Range("F4").Select
ActiveCell.FormulaR1C1 = "27"
Range("G4").Select
ActiveCell.FormulaR1C1 = "28"
Range("A5").Select
ActiveCell.FormulaR1C1 = "29"
Range("B5").Select
ActiveCell.FormulaR1C1 = "30"
Range("C5").Select
ActiveCell.FormulaR1C1 = "31"
Range("D5").Select
ActiveCell.FormulaR1C1 = "31"
Range("E5").Select
ActiveCell.FormulaR1C1 = "33"
Range("F5").Select
ActiveCell.FormulaR1C1 = "34"
Range("G5").Select
ActiveCell.FormulaR1C1 = "35"
Range("A6").Select
ActiveCell.FormulaR1C1 = "36"
Range("B6").Select
ActiveCell.FormulaR1C1 = "37"
Range("C6").Select
ActiveCell.FormulaR1C1 = "38"
Range("D6").Select
ActiveCell.FormulaR1C1 = "39"
Range("E6").Select
ActiveCell.FormulaR1C1 = "40"
Range("F6").Select
ActiveCell.FormulaR1C1 = "41"
Range("G6").Select
ActiveCell.FormulaR1C1 = "42"
Range("A7").Select
ActiveCell.FormulaR1C1 = "43"
Range("B7").Select
ActiveCell.FormulaR1C1 = "44"
Range("C7").Select
ActiveCell.FormulaR1C1 = "45"
Range("D7").Select
ActiveCell.FormulaR1C1 = "46"
Range("E7").Select
ActiveCell.FormulaR1C1 = "47"
Range("F7").Select
ActiveCell.FormulaR1C1 = "487"
Range("F7").Select
ActiveCell.FormulaR1C1 = "48"
Range("G7").Select
ActiveCell.FormulaR1C1 = "49"
Range("H7").Select
End Sub

Anzeige
AW: In VBA: A1:G7 = 1 bis 49
04.12.2003 11:00:01
N. Davidheimann
Hallo Klaus,

ich dank' Dir ja für Deine Hilfe .. nur .. der "Erfinder" von VBA würde sich im Grabe umdrehen....

Gruß
Norbert
AW: In VBA: A1:G7 = 1 bis 49
04.12.2003 10:41:44
WernerB.
Hallo Norbert,

es ist zwar etwas mehr als eine Codezeile geworden, aber es sollte funktionieren:

Sub Norbert()
Dim c As Range
Dim i As Byte
Application.ScreenUpdating = False
For Each c In Range("A1:G7")
i = i + 1
c.Value = i
Next c
Application.ScreenUpdating = True
End Sub

Viel Erfolg wünscht
WernerB.

P.S.: Das Forum lebt auch von den Rückmeldungen der Fragesteller an die Antworter (siehe Forums-FAQ).
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige