#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"