A little date formatting puzzle

Cath

Board Regular
Joined
Aug 10, 2005
Messages
156
Hi

Just got my array to work (thanks for the help everyone)

However I take a date, eg, 17/11/05 (format dd/mm/yy), it goes into an array, and if I check the value it is still 17/11/05. It is then entered into a cell (who's format is dd/mm/yy), but when I look at the results, it says 11/17/05 but strangely the format is still dd/mm/yy??

Has anyone any idea how to change this? I could understand if it had defaulted to m/d/y as I could just change it back, but now it actually has the wrong date in?

Thanks

Cath
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
just a small test - what's happen to the cell if you choose a number format?

does it show 38672 as result or still the same date than previous?
 
Upvote 0
I'm not sure, the array is just defined as dim values (15). Should I define it as something else (not everything in there is dates, there is text and numbers)
 
Upvote 0
i'm not expert in macro but you can maybe try :
Code:
Dim values(15) As Date
but you must store only date in the array

otherwise i dont think it will work.
 
Upvote 0
You can use something in the trend of:
Code:
dim temp as date
temp = values(i)
Cell(x, y).value = temp
 
Upvote 0
The odd thing is now I can't reformat that data as anything, its stuck as 11/17/2005! All my previous ones that I saved at least could be changed?
 
Upvote 0

Forum statistics

Threads
1,224,315
Messages
6,177,842
Members
452,809
Latest member
mar_luna

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