Date from VBA form comes into worksheet as text

  • Thread starter Thread starter ButterflyGirl
  • Start date Start date
B

ButterflyGirl

In a form I input a date & when it comes across to the excel worksheet it
recognises it as text rather than a date (even though it looks like a date eg
in worksheet date looks like 16/06/09.
Look forward to your answer.
 
Make sure its Dim'ed correctly:

Sub OnlyaMoth()
Dim d As Date
d = Application.InputBox(prompt:="Give me a date", Type:=1)
Range("A1").Value = d
End Sub
 
B-G,

From the form to the worksheet:

Worksheets("Sheet Name").Range("A1").Value = DateValue(me.Textbox1.Text)

HTH,
Bernie
MS Excel MVP
 
Back
Top