Home

Date Field

%3CLINGO-SUB%20id%3D%22lingo-sub-662262%22%20slang%3D%22en-US%22%3EDate%20Field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-662262%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20automatically%20print%20the%20correct%20date%20to%20a%20sign%20in%20sheet%20and%20I%20can't%20remember%20how%20to%20do%20it.%20I%20print%20the%20sheets%20for%20each%20day%20of%20the%20month%20once%20a%20month%20and%20currently%20hand%20write%20them%20in.%20Is%20it%20possible%20to%20have%20it%20print%20the%20date%20on%20the%20sheet%20automatically%20for%20each%20day%20of%20the%20month%3F%26nbsp%3B%20%26nbsp%3BThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-662262%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-662523%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20Field%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-662523%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F352905%22%20target%3D%22_blank%22%3E%40Needra%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%3CP%3Eyou%20can%20use%20this%20macro%20to%20do%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EFunction%20LTImMo(inputdate%20As%20Date)%20As%20Integer%3CBR%20%2F%3E%3CBR%20%2F%3ELTImMo%20%3D%20Day(DateSerial(Year(inputdate)%2C%20Month(inputdate)%20%2B%201%2C%200))%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20Function%3CBR%20%2F%3E%3CBR%20%2F%3ESub%20PrintEveryDayOfMonth()%3CBR%20%2F%3EDim%20intMonat%20As%20Integer%3CBR%20%2F%3EDim%20intLastDay%20As%20Integer%3CBR%20%2F%3EDim%20i%20As%20Integer%3CBR%20%2F%3EDim%20wksBlatt%20As%20Worksheet%3CBR%20%2F%3E%3CBR%20%2F%3EWith%20Tabelle1%3CBR%20%2F%3E%3CBR%20%2F%3EintLastDay%20%3D%20LTImMo(Date)%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20i%20%3D%201%20To%20intLastDay%3CBR%20%2F%3E%3CBR%20%2F%3E.Range(%22A1%22).Value%20%3D%20DateSerial(2019%2C%20Month(Date)%2C%20i)%3CBR%20%2F%3E.PrintOut%3CBR%20%2F%3E%3CBR%20%2F%3ENext%20i%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20With%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20Sub%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EBernds%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.vba-tanker.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewww.vba-tanker.com%3C%2FA%3E%20-%20a%20database%20full%20of%20excel-macros%3C%2FP%3E%3C%2FLINGO-BODY%3E
Needra
Occasional Visitor

I am trying to automatically print the correct date to a sign in sheet and I can't remember how to do it. I print the sheets for each day of the month once a month and currently hand write them in. Is it possible to have it print the date on the sheet automatically for each day of the month?   Thanks

1 Reply

@Needra 

Hi, 

you can use this macro to do it.

 

Function LTImMo(inputdate As Date) As Integer

LTImMo = Day(DateSerial(Year(inputdate), Month(inputdate) + 1, 0))

End Function

Sub PrintEveryDayOfMonth()
Dim intMonat As Integer
Dim intLastDay As Integer
Dim i As Integer
Dim wksBlatt As Worksheet

With Tabelle1

intLastDay = LTImMo(Date)


For i = 1 To intLastDay

.Range("A1").Value = DateSerial(2019, Month(Date), i)
.PrintOut

Next i


End With


End Sub

 

Best regards

Bernds

www.vba-tanker.com - a database full of excel-macros

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies