Date Field

Copper Contributor

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