View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Simon Woods[_3_] Simon Woods[_3_] is offline
external usenet poster
 
Posts: 6
Default NumberFormat not taking

Hi

I'm loading data into a sheet. I'm setting the NumberFormat of the column

' ---- set default date format i.e. "dd-mm-yyyy"
l_oSheet.Columns(l_nCol).NumberFormat = C_DEFAULT_DATEFORMAT

' ---- if a custom format for the data is set, use that i.e. "mm/yy"
If LenB(.Format(l_nCol)) < 0 Then
l_oSheet.Columns(l_nCol).NumberFormat = .Format(l_nCol)
End If

When I load the data, the data is being displayed in "dd/mm/yyyy" format
irrespective of the format I'm setting the column to. I've also tried
setting the NumberFormat of each cell and this makes no difference

What more do I need to do to get Excel to recognise my custom format. Or do
I need to use a completely different mechanism?

Thanks

Simon