View Single Post
  #5   Report Post  
Duke Carey
 
Posts: n/a
Default

The function is lacking a line of code and, as a result, doesn't update
automatically.
It looks like that code ought to be as shown below. However, changing the
format of a cell doesn't appear to trigger a recalc of the sheet and,
derivatively, this function. So, after you change a cell's format, press the
F9 key to make these things all recalculate

Public Function CurrencyType(rng As Range) As String
Application.Volatile
If InStr(1, rng(1, 1).NumberFormat, "‚¬") 0 Then
CurrencyType = "Euro"
Exit Function
ElseIf InStr(1, rng(1, 1).NumberFormat, "$") 0 Then
CurrencyType = "Dollar"
Exit Function
End If
CurrencyType = "None"
End Function


"Duke Carey" wrote:

Paste the code below into a VBA module in your workbook, then use it to
identify the format type in cell A1 by entering this formula into cell B1

=CurrencyType(A1)

for guidance on how to use code, look at this site

http://www.mvps.org/dmcritchie/excel/getstarted.htm


Public Function CurrencyType(rng As Range) As String
If InStr(1, rng(1, 1).NumberFormat, "‚¬") 0 Then
CurrencyType = "Euro"
Exit Function
ElseIf InStr(1, rng(1, 1).NumberFormat, "$") 0 Then
CurrencyType = "Dollar"
Exit Function
End If
CurrencyType = "None"
End Function


"Devlin" wrote:

I will gladly add another column, but what formula should I use? I
can't input the Euro or Dollar signs in each cell of the column
manually, so I have to find a formula to do this for me... and after
that use a sumif :)