Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am using VBA's inbuilt date function. I am making that date to print in one of Excel sheet's cells. The problem is date is printed on the cell as #########. When i click on that cell i can see the correct date in the formula bar. What is wrong? Below is my code: Private Sub txtDate_Change() txtDate = Format(Date, "mm/dd/yy") Cells(1, 2) = txtDate.Text ' Printing it in the B1 cell End Sub I even tried something like this: Sub Macro1() Range("B1").NumberFormat = "dddd mmm.d yyyy" Range("B1").Value = Date End Sub In both the cases the answer is ####### in the B1 cell. Any help on this will be greatly appreciated. I dont know where i am going wrong. Regards Shilpa |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try widening the column.
-- HTH Bob Phillips wrote in message oups.com... Hi, I am using VBA's inbuilt date function. I am making that date to print in one of Excel sheet's cells. The problem is date is printed on the cell as #########. When i click on that cell i can see the correct date in the formula bar. What is wrong? Below is my code: Private Sub txtDate_Change() txtDate = Format(Date, "mm/dd/yy") Cells(1, 2) = txtDate.Text ' Printing it in the B1 cell End Sub I even tried something like this: Sub Macro1() Range("B1").NumberFormat = "dddd mmm.d yyyy" Range("B1").Value = Date End Sub In both the cases the answer is ####### in the B1 cell. Any help on this will be greatly appreciated. I dont know where i am going wrong. Regards Shilpa |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
date problem in excel | Excel Worksheet Functions | |||
excel date problem | Excel Worksheet Functions | |||
date problem in excel | Excel Discussion (Misc queries) | |||
Date format problem in Excel | Excel Programming | |||
Excel Date/Time problem | Excel Programming |