ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   getformat (https://www.excelbanter.com/excel-programming/405840-getformat.html)

Yendorian

getformat
 
I need to identify which currency format is being used in a particular cell
on an Excel worksheet. (Excel 2003). Ideally I'd like the format to appear
next to the cell in question.
e.g. $ 100.00 [$ #,##0.00]
Can anyone tell me how to do this, please? Thanks

Bob Phillips

getformat
 
Create a UDF


Function CellFormat(rng As Range)
If rng.Cells.Count 1 Then

CellFormat = CVErr(xlErrRef)
Else

CellFormat = rng.NumberFormat
End If
End Function

and use lkike so

=CellFormat(B2)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Yendorian" wrote in message
...
I need to identify which currency format is being used in a particular cell
on an Excel worksheet. (Excel 2003). Ideally I'd like the format to appear
next to the cell in question.
e.g. $ 100.00 [$ #,##0.00]
Can anyone tell me how to do this, please? Thanks




Yendorian

getformat
 
Hi Bob,
Thanks for the rapid reply.
Sorry - I'm new to VBA and have no experience of UDFs.
I've entered the Function you sent me into a module but I don't know how to
activate it. aqny possibility of helping out again, please?
Yendorian

"Bob Phillips" wrote:

Create a UDF


Function CellFormat(rng As Range)
If rng.Cells.Count 1 Then

CellFormat = CVErr(xlErrRef)
Else

CellFormat = rng.NumberFormat
End If
End Function

and use lkike so

=CellFormat(B2)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Yendorian" wrote in message
...
I need to identify which currency format is being used in a particular cell
on an Excel worksheet. (Excel 2003). Ideally I'd like the format to appear
next to the cell in question.
e.g. $ 100.00 [$ #,##0.00]
Can anyone tell me how to do this, please? Thanks






All times are GMT +1. The time now is 08:09 PM.

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