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.

Variant auf leeren Inhalt überprüfen

Empfohlene Antworten

Veröffentlicht

hi@all!

ich habe einen Variant StartTime, der zu Beginn meines Excel-VBA-Programms auf die aktuelle Systemzeit gesetzt wird.

StartTime = Now

Wird das Programm während der Laufzeit unterbrochen, kann die Laufzeit nicht richtig berechnet werden. Das will ich überprüfen, indem ich vor der Ausgabe der Laufzeit teste, ob die globale Variable StartTime (die im Fall eines Abbruchs zurückgesetzt wird) leer ist. Frage: Wie geht das??

If StartTime Is Null Then

If StartTime Is Empty Then

If StartTime Is "" Then

und

If StartTime Is 0 Then

funktionieren alle nicht. Lasse ich mir StartTime in einer MsgBox ausgeben, ist es ein leerer String, also sollte es eigentlich mit der Abfrage nach "" funzen, tut es aber nicht. Weiß jemand Rat?

MfG

Mario

das einzige was mir einfällt ist:

if int(variant) = 0 then

'leer

else

'voll

endif

Hallo!

Versuch es doch mal mit :

'falls die Variable schon gesetzt ist :

'---------------------------------

If Not StartTime Is Nothing Then

'setze sie zurück :

'-----------------

StartTime = Nothing

End If

Weiss nicht, ob das auch in VBA funktioniert - so funktionierts auf jeden Fall in VB.NET !

MFG Timo

Mit Nothing gehts leider nicht, aber...

das einzige was mir einfällt ist:

if int(variant) = 0 then

'leer

else

'voll

endif

...das funktioniert! Dankeschön!

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.