ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How To: Use Cell("Format") to return MMMM YYYY instead of D3 (https://www.excelbanter.com/excel-programming/298633-how-use-cell-format-return-mmmm-yyyy-instead-d3.html)

Kevin McCartney[_2_]

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
Hi
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

TI
KM

Frank Kabel

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
Hi
AFAIK this is not possible with using only worksheet
functions

-----Original Message-----
Hi,
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?


TIA
KM
.


Kevin McCartney[_2_]

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
What does AFAIK mea

----- Frank Kabel wrote: ----

H
AFAIK this is not possible with using only worksheet
function

-----Original Message----
Hi
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
TI

K



Thomas Ramel

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
Grüezi Kevin

Kevin McCartney schrieb am 18.05.2004

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?


There might be a possibility when you use xl4Macros in a defined name.

Insert -- Names -- Define -- Names in Workbook: 'Cellformat' -- Refers
to:

=GET.CELL(7;INDIRECT("RC(-1)";FALSE))

-- [Add] -- [OK]

When you like to see the format of A1, then:

B1 =Cellformat

'Cellformat' evaluates the cell left of where you use it in the table.

--
Mit freundlichen Grüssen

Thomas Ramel
- MVP für Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]

Frank Kabel

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
Hi
AFAIK: As far as I know

-----Original Message-----
What does AFAIK mean

----- Frank Kabel wrote: -----

Hi
AFAIK this is not possible with using only worksheet
functions

-----Original Message-----
Hi,
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?
TIA

KM
.

.


Tom Ogilvy

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
it might be important to note that if you copy a cell using this formula and
paste it on another sheet, in xl2000 and earlier, this will cause a general
protection fault, excel will close and you will loose any changes to your
workbook.

I believe xl2002 and possibly xl2003 are more tolerant.
--
Regards,
Tom Ogilvy

"Thomas Ramel" wrote in message
...
Grüezi Kevin

Kevin McCartney schrieb am 18.05.2004

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?


There might be a possibility when you use xl4Macros in a defined name.

Insert -- Names -- Define -- Names in Workbook: 'Cellformat' -- Refers
to:

=GET.CELL(7;INDIRECT("RC(-1)";FALSE))

-- [Add] -- [OK]

When you like to see the format of A1, then:

B1 =Cellformat

'Cellformat' evaluates the cell left of where you use it in the table.

--
Mit freundlichen Grüssen

Thomas Ramel
- MVP für Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]




Thomas Ramel

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
Grüezi Tom

Tom Ogilvy schrieb am 18.05.2004

it might be important to note that if you copy a cell using this formula and
paste it on another sheet, in xl2000 and earlier, this will cause a general
protection fault, excel will close and you will loose any changes to your
workbook.


Thanks for upgrading my knowledge :-)

I believe xl2002 and possibly xl2003 are more tolerant.


It may be that SP3 fixed this problem - Excel refuses to paste this
'macro-formula', but it stays alive.

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]

david mcritchie

How To: Use Cell("Format") to return MMMM YYYY instead of D3
 
Hi Kevin,
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

=GetFormat(A3)
=Personal.xls!GetFormat(A3)-
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Kevin McCartney" wrote in message ...
Hi,
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?


TIA
KM




Harlan Grove[_5_]

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.


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com