Zellen nach Links verschieben

  • Excel

Es gibt 7 Antworten in diesem Thema. Der letzte Beitrag () ist von Martin1337.

    Zellen nach Links verschieben

    Hi zusammen,

    ich habe mal wieder eine kleine Challenge.

    Ich bräuchte ein Makro was Zellen von rechts nach Links verschiebt.

    und zwar sind im Bereich E4 bis AH124 Daten gefüllt. Jedesmal wenn ich das Makro ausführe soll die Spalte E die Werte von F, die Spalte F von G (usw. bis AH von AI die Daten übernehmen soll) übernehmen.

    Was ich derzeit im VBA erstellt habe funktioniert zwar, allerdings benötigt Excel dann einige Zeit bis er alle Zellen durch hat:


    Private Sub verschiebe_werte()

    Dim Spalte As Long
    Dim zeile As Long

    For Spalte = Range("E4").Column To Range("AH4").Column

    For zeile = Range("E6").Row To Range("E124").Row

    Tabelle3.Cells(zeile, Spalte).Value = Tabelle3.Cells(zeile, Spalte + 1)

    Next zeile
    Next Spalte

    End Sub

    Habt ihr eine andere Idee wie ich das schneller hinbekomme?

    Danke und Gruß Martin
    Wenn ich das richtig verstehe möchtest du einfach bei Spalte "E" eine neue Spalte einfügen.
    Das geht einfach so:

    Visual Basic-Quellcode

    1. Columns("E:E").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    Alternativ zur Ganzen Zeile kann man natürlich auch nur einen Teil der Zeile Einfügen.

    Visual Basic-Quellcode

    1. Range("E4:E45").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    @petaod jetzt wo du das so sagst sehe ich das auch. Mist. Das ist ja doof.

    Ich nehme alles zurück!

    Sowohl "CUT" als auch "DELETE - SHIFT" sind gute varianten.
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    danke für die Antworten.

    Range("F6:AH124").Cut Range("E6:AG124") hat geholfen. Ich habe allerdings aus .Cut eine .copy function drauß gemacht, denn die letzte Spalte wird mit einem anderen makro eh überschrieben. Mit .cut hats es leider die Formatierungen durcheinander geworfen, und bei Copy war alles super :)