florian86
Goto Top

Word Formel Monat -1

Hallo,

ich habe folgende Formel im Word 2016

{ = ({ date \@ "MMMM" } -1) }

jetzt bringt mir diese nach dem aktualisieren folgenden Fehler...

!Textmarke nicht definiert, NOVEMBER

Ich möchte einfach nur den aktuellen Monat -1 anzeigen lassen.

MfG

Florian

Content-Key: 392454

Url: https://administrator.de/contentid/392454

Printed on: April 19, 2024 at 04:04 o'clock

Mitglied: 137808
Solution 137808 Nov 12, 2018 updated at 10:56:36 (UTC)
Goto Top
From "strings" like "november" you cannot subtract a number... face-wink.
{ ={DATE \@ "MM"}-1 }  
Member: Florian86
Florian86 Nov 12, 2018 at 11:09:43 (UTC)
Goto Top
Ist es als VBA Lösbar?
Mitglied: 137808
137808 Nov 12, 2018, updated at Nov 13, 2018 at 09:05:26 (UTC)
Goto Top
Sure.

Just create a bookmark name it according to your needs modify it in the code below) and set the contents of it to your date calculation
ActiveDocument.Bookmarks("my_custom_marker").Range.Text = Format(DateAdd("m", -1, Date), "MMMM")