Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
VBA copy und paste
#11
Hallo,

per VBA via Index/Vergleich so:

Code:
Sub StattFormel()   'schön flexibel
    Dim arrList(): arrList = Tabelle1.Range("A1:F4")
    arrList = Application.Index(arrList, Evaluate("row(1:" & UBound(arrList, 1) & ")"), Array(1, 3, 4, 6, 5))
End Sub

oder
Sub StattFormel1()  'Einzeiler
    Tabelle1.Range("A1") = Application.Index(Tabelle1.Range("A1:F4"), Evaluate("row(1:" & Tabelle1.Range("A1:F4").Rows.Count & ")"), Array(1, 3, 4, 6, 5))
End Sub

Ich weiß jetzt nicht, ob O2021 schon Spaltenwahl kennt. Das wäre dann ressourcenschonender als SEQUENZ(). =SPALTENWAHL(A1:F4;1;3;4;6;5)

In VBA ist leider SPALTENWAHL() bisher nicht vorhanden. Das wird also auch mit Evaluate nicht zum Ziel führen.

Sabinas Formel ver VBA't:
Code:
Sub SpaltenwahlViaSequence()
    Dim rng As Range, arr()
    Set rng = Tabelle1.Range("A1:F4")
    arr = Application.Index(rng, WorksheetFunction.Sequence(rng.Rows.Count), Array(1, 3, 4, 6, 5))
    Tabelle1.Range("A1").Resize(UBound(arr), UBound(arr, 2)).Value = arr
End Sub


Gruß Uwe
Zitieren


Nachrichten in diesem Thema
VBA copy und paste - von Thomasius - 23.12.2025, 19:15
RE: VBA copy und paste - von Flotter Feger - 23.12.2025, 23:04
RE: VBA copy und paste - von Thomasius - 24.12.2025, 13:04
RE: VBA copy und paste - von Flotter Feger - 27.12.2025, 16:14
RE: VBA copy und paste - von Thomasius - 29.12.2025, 18:44
RE: VBA copy und paste - von Flotter Feger - 30.12.2025, 13:20
RE: VBA copy und paste - von Thomasius - 30.12.2025, 19:44
RE: VBA copy und paste - von Flotter Feger - 03.01.2026, 18:33
RE: VBA copy und paste - von Thomasius - 03.01.2026, 20:39
RE: VBA copy und paste - von Flotter Feger - 04.01.2026, 00:51
RE: VBA copy und paste - von PetrolMaxxe - 04.01.2026, 10:53
RE: VBA copy und paste - von RPP63 - 04.01.2026, 11:20
RE: VBA copy und paste - von PetrolMaxxe - 04.01.2026, 11:24
RE: VBA copy und paste - von PetrolMaxxe - 04.01.2026, 11:59
RE: VBA copy und paste - von Flotter Feger - 05.01.2026, 07:41
RE: VBA copy und paste - von PetrolMaxxe - 05.01.2026, 12:31
RE: VBA copy und paste - von Thomasius - 05.01.2026, 16:12

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste




Hinweis auf Angebot Excel-Inside - lang    Keine Lösung gefunden? Du kannst Dich gerne an unser erfahrenes Experten-Team wenden um dein Anliegen zu besprechen.
   Gerne erstellen wir auf dieser Basis ein Angebot.
   Sende deine Anfrage einfach
per E-Mail an anfrage@excel-inside.de


Powerd and supported by Excel-InsideSolutions