Ask Your Question
0

What would the correct code be for this VBA

asked 2017-01-29 20:42:39 +0200

alex4478 gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-01-29 21:36:29 +0200

karolus gravatar image

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

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-01-29 20:42:39 +0200

Seen: 67 times

Last updated: Jan 29 '17