gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
The following code is writing the date as mm/dd and not as dd/mm specified: If Not…
- User
The following code is writing the date as mm/dd and not as dd/mm specified: If Not emptyCell Is Nothing Then emptyCell.Value = Application.WorksheetFunction.text(Date, "dd/mm") End If
- Assistant
To specify the date format as dd/mm, you need to change the format of the cell. Here's the modified code:
VBAIf Not emptyCell Is Nothing Then emptyCell.NumberFormat = "dd/mm" emptyCell.Value = Date End IfThis code will set the number format of the cell to "dd/mm" and assign the current date to the cell, which will be displayed in the specified format.