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.

VBA Probleme mit Select und IF

Empfohlene Antworten

Veröffentlicht

Hallo,

in meinem Makro beziehe ich Daten aus einer Textdatei. Wenn ein bestimmtes Feld = 0 ist soll der Datensatz in Tabelle1 geschrieben werden, andernfalls in Tabelle2. Mein Ansatz ist der hier: (funktioniert nicht)


Do While x = 0


        i = i + 1


        'Zeilen mit offene Menge = 0 in Tabelle 2 einfügen und in Tabelle 1 löschen

        If Cells(i, "k").Select <> 0 Then


            rows(i).Select

            Selection.Copy

            Sheets("Offene Positionen").Select

            k = k + 1

            rows(k).Select

            ActiveSheet.Paste


            Sheets("Gesamtübersicht").Select          

            rows(i).Select

            Selection.Delete Shift:=xlUp


        End If


        x = x + 1


        If Cells(i, "A").Select = "" Then


         x = 1


        End If


    Loop

mfg hyperion

Mein Ansatz ist der hier [...]

gut und schön, aber...

(funktioniert nicht)

funktioniert

1. was

2. wo

3. mit welchem erwarteten und eintreffenden resultat

nicht?

was du vorhast ist mir in etwa klar, in ermangelung von daten ist das allerdings ein ratespiel.

Cells.Select auf ungleich 0 zu prüfen macht IMO keinen sinn und deine schleife dürfte wohl nur ein einziges mal (oder gar kein mal) durchlaufen werden, abhängig von x.

hast du den code zeilenweise im debug-modus laufen lassen?

s'Amstel

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.