![]() |
Date from VBA form comes into worksheet as text
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. -- Thanks, Butterfly Girl |
Date from VBA form comes into worksheet as text
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 -- Gary''s Student - gsnu200857 "ButterflyGirl" wrote: 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. -- Thanks, Butterfly Girl |
Date from VBA form comes into worksheet as text
B-G,
From the form to the worksheet: Worksheets("Sheet Name").Range("A1").Value = DateValue(me.Textbox1.Text) HTH, Bernie MS Excel MVP "ButterflyGirl" wrote in message ... 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. -- Thanks, Butterfly Girl |
All times are GMT +1. The time now is 02:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com