Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi All,
I have a problem with an excel funtion that i created, i have a series of defined named range pointing to various cells, however, i cannot seem to call them out within my procedure. Could anyone please help? It is like something below: Function CCY_CALC(PosVal, CCY) CCYType = CCY Select Case CCYType Case "AUD" ' AUD_USD is the defined name which points to a cell with the amount of 1.3 RateD = CCY_CALC * AUD_USD Case "CAD" ' AUD_USD is the defined name which points to a cell with the amount of 1.01 RateD = CCY_CALC * CAD_USD End Select CCY_CALC = RateD End Function Thanks in advance Ray |
#2
![]() |
|||
|
|||
![]()
Hi all,
Sorry slight error in my code, it should be as follows: Function CCY_CALC(PosVal, CCY) CCYType = CCY Select Case CCYType Case "AUD" ' AUD_USD is the defined name which points to a cell with the amount of 1.3 RateD = PosVal * AUD_USD Case "CAD" ' AUD_USD is the defined name which points to a cell with the amount of 1.01 RateD = PosVal * CAD_USD End Select CCY_CALC = RateD End Function |
#3
![]() |
|||
|
|||
![]()
Hi SwiftCode,
Change: RateD = PosVal * AUD_USD to RateD = PosVal * Range("AUD_USD") and change: RateD = PosVal * CAD_USD to RateD = PosVal * Range("CAD_USD") --- Regards, Norman "swiftcode" wrote in message ... Hi all, Sorry slight error in my code, it should be as follows: Function CCY_CALC(PosVal, CCY) CCYType = CCY Select Case CCYType Case "AUD" ' AUD_USD is the defined name which points to a cell with the amount of 1.3 RateD = PosVal * AUD_USD Case "CAD" ' AUD_USD is the defined name which points to a cell with the amount of 1.01 RateD = PosVal * CAD_USD End Select CCY_CALC = RateD End Function |
#4
![]() |
|||
|
|||
![]()
Hi SwiftCode,
And that would be better with: RateD = PosVal * Range("AUD_USD").Value and RateD = PosVal * Range("CAD_USD").Value Whilst Value is the default property of the range object, it is good practice to be explicit. --- Regards, Norman "Norman Jones" wrote in message ... Hi SwiftCode, Change: RateD = PosVal * AUD_USD to RateD = PosVal * Range("AUD_USD") and change: RateD = PosVal * CAD_USD to RateD = PosVal * Range("CAD_USD") --- Regards, Norman "swiftcode" wrote in message ... Hi all, Sorry slight error in my code, it should be as follows: Function CCY_CALC(PosVal, CCY) CCYType = CCY Select Case CCYType Case "AUD" ' AUD_USD is the defined name which points to a cell with the amount of 1.3 RateD = PosVal * AUD_USD Case "CAD" ' AUD_USD is the defined name which points to a cell with the amount of 1.01 RateD = PosVal * CAD_USD End Select CCY_CALC = RateD End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Blank cells in named range- how to ignore them when making my graph? Help plz! | Excel Discussion (Misc queries) | |||
Offset Function works in cell, not in named range | Excel Worksheet Functions | |||
multi function cells | Excel Discussion (Misc queries) | |||
Excel option to store trendline's coefficients in cells for use | Charts and Charting in Excel | |||
how to move user defined function | Excel Worksheet Functions |