PDA

View Full Version : [SOLVED] Inputbox with date used as European style



mbdigital
01-17-2018, 03:09 AM
***** SOLVED *****

Hi to you all.

I have a (maybe) simple question but can;t find the answer anywhere.

I have the following code :



DatumOfPayment = InputBox("Wat is de date of payment ? (dd-mm-yyyy)")
MsgBox (DatumOfPayment & "is being noted")
ActiveCell.Offset(0, -3).Select
ActiveCell.FormulaR1C1 = DatumOfPayment


The problem is that in the selected cell the date has to be entered as European style date (dd-mm-yyyy) and not in Us style date (mm-dd-yyyy)

What can be the solution so that my entered date will be shown in the selected cell as European date ?

Thanks in advance for your help.

Kenneth Hobs
01-17-2018, 12:39 PM
Use CDate() on DatumOfPayment. If the numberformat is not set, that can always be set by macro as well.