View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] kieranish@gmail.com is offline
external usenet poster
 
Posts: 2
Default reformating date

Excel has misinterpretted the date values from a web query - so Feb-08
is 01/02/08 rather than 08/02/07. The problem is that if I use VBA to
correct this it uses the underlying excel date value (ie 39479) rather
than the cell contents.

I want to do something like this - but on the cell contents:

Public Sub fixdates()
Application.ScreenUpdating = False
For Each Cell In ActiveSheet.UsedRange.Columns("h:h").Cells
Cell.Value = DateValue(Right(Cell.Value, 2) & "/02/07")
Next Cell
Application.ScreenUpdating = True
End Sub

Any suggestions?

Thanks in advance,

Kieran