Problem with textbox using date format.

Skip Bisconer

Active Member
Joined
Jun 14, 2002
Messages
263
I have a multipage form to enter maintenance data onto a spreadsheet and I am having a problem getting the correct results from a textbox with a date mm/dd/yy to enter into a cell. The result I am getting in Cells(NextRow, 1) for the date 12/27/03 is "27ate". For 01/04/04 is "4ate".
I have tried dropping the format line and just formatting the column in the speadsheet and that doesn't make any difference. There are no other references to Cells(NextRow, 1) in my VBA for this page.
:oops: I am baffled. Any help out there?

Sheets("Dodge").Activate

NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 1

' Apply user entry to form to Dodge worksheet

Cells(NextRow, 1) = txtDateD
Cells(NextRow, 1) = Format(Cells(NextRow, 1), "Date")
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi Skip

Cells(NextRow, 1) = Format(Cells(NextRow, 1), "Date")

should be

Cells(NextRow, 1) = Format(Cells(NextRow, 1), "DD/MM/YYYY")

Lookup Format in the Help files

Your Org formula is Readind "Date" as Day + "ate" hence the 4ate
 
Upvote 0

Forum statistics

Threads
1,203,502
Messages
6,055,772
Members
444,822
Latest member
Hombre

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top