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.

Probleme bei Datumsfunktionen in VBA

Empfohlene Antworten

Hallo Forum,

ich habe ein Problem. und zwar möchte ich zu einem Datum 5 Tage hinzu zählen. Leider hat mein Code einen kleinen Logikfehler:


dim grenzdatum as date

grenzdatum = Day(Date) + 5 & "." & Month(Date) & "." & Year(Date)

Wenn man das heutige Datum zugrunde legt ergibt sich ein Wert von

grenzdatum = "32.09.2004", was natürlich Schwachsinn ist.

Gibt es eine Möglichkeit, wie ich VBA sagen, kann dass es auch den Monat

wechseln soll, wenn so ein Blödsinn rauskommen würde ;o)

Danke und Gruß

Druid :cool:

etwa so in der art:

Dim das As Date

das = "30.10.2004"

das = das + 5

;)

ähm, danke... *räusper* Da hätte ich glaub ich auch selber nachdenken können... ICH D***

Gruß

Druid :cool:

Hi,

ich empfehle hierzu die Funktion DateAdd:

DateAdd("d", 5, Date)

Damit kann man dann auch Monate, Jahre etc. addieren.

hth,

Stephan

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.