What would the correct code be for this VBA

Hi,

I have a spreadshhet that when a button is pressed asks the user for a date, when a date is put into the box the spreadsheet is populate with dates related to the asked start date.

This is the VBA code,

`Rem Attribute VBA_ModuleType=VBADocumentModule
Option VBASupport 1
Option Explicit

Sub startdate()
Dim c As Range
Dim x As Date
Set c = Range(“D2”)
x = InputBox(“what is the start date? mm/dd/yy”)
c.Value = x

End Sub
Private Sub CommandButton3_Click()
Call startdate
End Sub`

but what would be the correct code for this to work in LibreOffice?

Many thanks for any assistance.

Absolutly useless… there is no advantage compared to allow the user direct input into D2, probably extended with →Data→Validity…