If you wish to utilise a single formula, have 2016+ with dynamic arrays, and are specifying the Month and Year to use, then just say:
A1: =TEXT(ROW(INDEX($A:$A,1):INDEX($A:$A,31)),"00\.") & TEXT(Mnth,"00\.") & Yr
With Yr = 2023 and Mnth = 2
To produce this using VBA, try this:
Option Explicit
Sub MonthDays()
Dim Yr As Long, y As String
Dim Mnth As Long, m As String
Dim vDates(1 To 31, 1 To 1) As Variant
Dim I As Long
Dim WS As Worksheet, rDest As Range
Yr = Application.InputBox(Prompt:="Enter the Year as 'yyyy'", Title:="Year Input", Default:=Year(Date), Type:=1)
Mnth = Application.InputBox(Prompt:="Enter the Month as 'm'", Title:="Month Input", Type:=1)
y = Format(Yr, "0000")
m = Format(Mnth, "00\.")
'Create array with the date strings
For I = 1 To 31
vDates(I, 1) = Format(I, "00\.") & m & y
Next I
'write to the worksheet
'below example shows one method
Set WS = ThisWorkbook.Worksheets("Sheet1")
With WS
Set rDest = Range(.Cells(1, 1), .Cells(31, 1))
End With
With rDest
.ClearContents
.NumberFormat = "@"
.Value = vDates
.EntireColumn.AutoFit
End With
End Sub