getformat

  • Thread starter Thread starter Yendorian
  • Start date Start date
Y

Yendorian

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
 
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)
 
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 said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top