Skip to content

Instantly share code, notes, and snippets.

@IshamMohamed
Created January 5, 2013 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IshamMohamed/4462930 to your computer and use it in GitHub Desktop.
Save IshamMohamed/4462930 to your computer and use it in GitHub Desktop.
A visual basic method for get currency code for various apps using google finance. If we put the currency values in a combo box, we can use this function with SelectedIndex() method of the combo box eg : fromCurrency = getCurrencyCode(toCurrencyListCombo.SelectedIndex)
Private Function getCurrencyCode(ByVal selectedIndex As Integer) As String
Dim str As String = ""
selectedIndex += 1
Select Case selectedIndex
Case 1
str = "AED"
Case 2
str = "ANG"
Case 3
str = "ARS"
Case 4
str = "AUD"
Case 5
str = "BDT"
Case 6
str = "BGN"
Case 7
str = "BHD"
Case 8
str = "BND"
Case 9
str = "BOB"
Case 10
str = "BRL"
Case 11
str = "BWP"
Case 12
str = "CAD"
Case 13
str = "CHF"
Case 14
str = "CLP"
Case 15
str = "CNY"
Case 16
str = "COP"
Case 17
str = "CRC"
Case 18
str = "CZK"
Case 19
str = "DKK"
Case 20
str = "DOP"
Case 21
str = "DZD"
Case 22
str = "EEK"
Case 23
str = "EGP"
Case 24
str = "EUR"
Case 25
str = "FJD"
Case 26
str = "GBP"
Case 27
str = "HKD"
Case 28
str = "HNL"
Case 29
str = "HRK"
Case 30
str = "HUF"
Case 31
str = "IDR"
Case 32
str = "ILS"
Case 33
str = "INR"
Case 34
str = "JMD"
Case 35
str = "JOD"
Case 36
str = "JPY"
Case 37
str = "KES"
Case 38
str = "KRW"
Case 39
str = "KWD"
Case 40
str = "KYD"
Case 41
str = "KZT"
Case 42
str = "LPB"
Case 43
str = "LKR"
Case 44
str = "LTL"
Case 45
str = "LVL"
Case 46
str = "MAD"
Case 47
str = "MDL"
Case 48
str = "MKD"
Case 49
str = "MUR"
Case 50
str = "MVR"
Case 51
str = "MXN"
Case 52
str = "MYR"
Case 53
str = "NAD"
Case 54
str = "NGN"
Case 55
str = "NIO"
Case 56
str = "NOK"
Case 57
str = "NPR"
Case 58
str = "NZD"
Case 59
str = "OMR"
Case 60
str = "PEN"
Case 61
str = "PGK"
Case 62
str = "PHP"
Case 63
str = "PKR"
Case 64
str = "PLN"
Case 65
str = "PYG"
Case 66
str = "QAR"
Case 67
str = "RON"
Case 68
str = "RSD"
Case 69
str = "RUB"
Case 70
str = "SAR"
Case 71
str = "SCR"
Case 72
str = "SEK"
Case 73
str = "SGD"
Case 74
str = "SKK"
Case 75
str = "SLL"
Case 76
str = "SVS"
Case 77
str = "THB"
Case 78
str = "TND"
Case 79
str = "TRY"
Case 80
str = "TTD"
Case 81
str = "TWD"
Case 82
str = "TZS"
Case 83
str = "UAH"
Case 84
str = "UGX"
Case 85
str = "USD"
Case 86
str = "UYU"
Case 87
str = "UZS"
Case 88
str = "VEF"
Case 89
str = "VND"
Case 90
str = "XOF"
Case 91
str = "YER"
Case 92
str = "ZAR"
Case 93
str = "ZMK"
Case Else
str = "USD"
End Select
Return str
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment