Date problem

paul_bam

New Member
Joined
Aug 10, 2007
Messages
23
Hello everyone,

I have a problem with a an excel spreadsheet solution I am doing. The problem is that I have a VBA form that allows the user to input the date, however, when the form runs it cpoies the value date value (amongsr other values) to particular cell within another sheet in the spreadsheet, but however I try to format the cells it always swaps the date to an American format (i.e. mm/dd/yyyy). What I require is English format (i.e. dd/mm/yyyy). I know the cells are formatted correctly, because if I enter the date manually it works fine, I am only experiencing the problem when the date is done via the VBA form.

Any help would be very much appreciated

Thanks in advance

PS The code I am using for the VBA form is below

Paul


Code:
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 1) = txtDate.Value
ActiveCell.Offset(0, 2) = txtPayroll.Value
ActiveCell.Offset(0, 3) = txtBuddy.Value
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try:

ActiveCell.Offset(0, 1).Value = DateValue(txtDate.Text)

Hello Andrew,

Thank you very much for posting back. Your amended code has successfully resolved my problem.

Thanks for your help, it is very much appreciated.

Paul
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,659
Members
449,091
Latest member
peppernaut

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