View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Harlan Grove[_5_] Harlan Grove[_5_] is offline
external usenet poster
 
Posts: 97
Default How To: Use Cell(

"David McRitchie" wrote...
For dates and time you may not necessarily get what you ask for
because Excel may take your format and say that is Kevn's regional
format. But see if this gets what you want -- it definitely will not
give you D3.
See my http://www.mvps.org/dmcritchie/excel....htm#getformat

Function GetFormat(Cell as Range) as String
GetFormat = cell.NumberFormat
End Function

...
"Kevin McCartney" wrote in message
I'm trying to get the format property of a of a cell with using macros
just using worksheet functions. When I use Cell("Format",A1) it returns D3,
but I need the MMMM YYYY custom format that I have placed on the cell to be
returned, any ideas how to get it?


In other words, there's no way to do this without using some form of macro
programming, either XLM formulas in defined names (which can be dangerous in
older XL versions) or VBA.

If the OP can't use VBA or XLM, the OP can't get the number format.

--
To top-post is human, to bottom-post and snip is sublime.