Date Formatting Issues

Pacman52

Active Member
Joined
Jan 29, 2009
Messages
428
Office Version
  1. 365
Platform
  1. Windows
Hi all I have a workbook with various Userforms on it for a user to input the relevant data into. I am currently entering some test data and have stumbled across an issue with some date formatting not being written to the worksheet correctly.

The odd thing is this seems to only happen on some rows and not all of them which to me makes me think the problem is with the worksheet formatting not the code behind the Userform. The Worksheet isn't storing the data as a table.

I've tried formatting the relevant columns on the worksheet by clicking on both the column reference letter and the individual cell and even changing the cell format to something other than a date and then back again but nothing seem to work.

Has anyone got any idea what's going with this and how to sort it out. I'm happy to provide more info and show the relevant code from the Userform if need be but as said the fact some rows work and some don't I'm pretty sure its not a code related problem.

Thanks for any responses Paul
 
Hi all thanks as always for the support and advice.

Thanks again Paul

Hi
just be aware CDate will error if no valid date is entered.

Glad we were able to help & appreciate your feedback

Dave
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Thanks Dave

I've coded the relevant areas to 'force' the user to input any dates in a date format so should not get any errors on the CDate.

Paul
 
Upvote 0

Forum statistics

Threads
1,224,878
Messages
6,181,529
Members
453,053
Latest member
DavidKele

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