Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hi

mit dem folgenden Code versuche ich daten von einer Tabelle in die andere zu kopieren (innerhalb eines Excel sheets)... bisher hat alles auch gut funktioniert, nur auf einmal baut das makro nur noch mist... wenn ich das Makro normal laufen lasse überspringt er Zeilen, wenn ich ihn im Debugger laufen lasse macht er die erste Spalte richtig aber den rest verschluckt er irgendwie - den Zellen werden Zwar Daten zugewiesen aber in der Tabelle seh ich gar nichts davon...

hier mal der code:


    Dim t As Integer

    Dim intColOr As Integer

    Dim intRow As Integer, intCol As Integer

    Dim intRow2 As Integer, intCol2 As Integer


    'ErgebnisCol

    intCol2 = 4

    'AusgangsCol

    intCol = -1

    intColOr = -1


    Do

      'ErgebnisRow

      intRow2 = 2

      'AusgangsRow

      intRow = 16

      t = 1

      Do While intRow2 < 32

        If t <> 6 Then

          intCol = intColOr

          intCol = intCol + 4

          intColOr = intCol

        End If

        intCol = intColOr

        intRow = intRow + 1

        t = 1

        Do While t <> 6

          Tabelle3.Cells(intRow2, intCol2).Value2 = Tabelle2.Cells(intRow, intCol)

          intCol = intCol + 1

          intRow2 = intRow2 + 1

          t = t + 1

        Loop

       Loop

    Loop While Tabelle2.Cells(intRow, intCol) <> ""

schon mal im voraus danke für eure Antworten

Morgen!

Was bewegen deine innerste Schleife bzw. Verzweigung?

Die erste (Verzweigung):

If t <> 6 Then

          intCol = intColOr

          intCol = intCol + 4

          intColOr = intCol

        End If

        intCol = intColOr

intCol = intColOr und zwar um 4 Größer, als vorher, wenn die Bedingung erfüllt ist. die zweite (Schleife):
Do While t <> 6

          Tabelle3.Cells(intRow2, intCol2).Value2 = Tabelle2.Cells(intRow, intCol)

          intCol = intCol + 1

          intRow2 = intRow2 + 1

          t = t + 1

        Loop

Ein Umbau von Senkrecht in waagerecht?

Falls ja, wirst du an geeigneter Stelle deine Variable intCol2 vergrößern müssen. bisher ist sie auf 4 gesetzt und wird dort auch bleiben. Du willst doch sicher eine Matrixartige Tabelle und nicht nur eine Ergebnisspalte.

Oder habe ich irgendetwas falsch interpretiert?

Original geschrieben von Der Kleine

Falls ja, wirst du an geeigneter Stelle deine Variable intCol2 vergrößern müssen. bisher ist sie auf 4 gesetzt und wird dort auch bleiben. Du willst doch sicher eine Matrixartige Tabelle und nicht nur eine Ergebnisspalte.

Oder habe ich irgendetwas falsch interpretiert?

DingDingDing 100Punkte :D

Ich hab den Fehler gefunden... hast recht intCol2 musste um eins erhöht werden(und noch ein paar andere kleine fehlerchen)...

Der Fehler kam wohl zu stande weil ich das Makro von einem anderen sheet auf das jetzige umbauen musste... trotzdem Danke! ;)

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.