Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Passing Currency format from one worksheet to another

Hello there,

I have a list of shares with the market prices in their respective
currencies. For example:
10 Microsoft - 10 USD
10 Nestle - 10 CHF
10 Siemens - 10 EUR

I now want to compute the total value of these shares in their respective
currencies, resulting in
10 Microsoft = 100 USD
10 Nestle = 100 CHF
10 Siemens = 100 EUR

How do I "remember" the market prices in the proper currency? Right now I
only "load" the actual number without refering to the currency:
sngMarketPrice_CURRENCY(lngRow) =
Worksheets(strWORKSHEET_NAME).Cells(lngRow, lngCol)

How can I keep the currency information when loading my array, and then
later on write the info "number + currency" into another worksheet.

Thank you for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Passing Currency format from one worksheet to another

A few questions so we can help you better:

What is the source of your data? An Excel spreadsheet, a CSV file,
or . . . "?

What is the format of this data? For example, is "10 Microsoft - 10
USD" all in one cell or field, or are they in 4 separate fields?

What is your function "sngMarketPrice_CURRENCY(lngRow)" doing? Can
you show us that code?

Are you trying to compute the values in multiple currencies (e.g., USD
and EUR, etc.)?

In general, you have to get the currency from whatever format it is
provided. From there, you can make multiple columns, one for each
currency, or you can have a column that simply designates the currency
(e.g., "USD"). In the first approach, you simply sum up the column.
In the second approach, you have to check the currency before summing
up the number. I would recommend the first approach if the number of
currencies is small. Much cleaner.

Alan
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Passing Currency format from one worksheet to another

Hello Alan,

All data are in 1 (one) column in an Excel spreadsheet. That one column
contains numbers that are formatted in different currencies. In my example
these numbers a

"USD 10.00"
"CHF 10.00"
"EUR 10.00"

The other information like "10 * Microsoft" is in 2 different columns.

"sngMarketPrice_CURRENCY(lngRow)" is not a function, but an array. Here is
my code:
m_udtIssuer(lngMaxIssuer).sngMarketPrice_CUR =
Worksheets(strWorksheet_Name).Cells(lngRow_Issuer, lngColumn_Market_Price)

So, "m_udtIssuer(lngMaxIssuer).sngMarketPrice_CUR" (in whatever currency)
should ideally contain the currency information as well (i.e., USD, CHF, EUR,
etc.).

Storing different currency numbers in different columns would be difficult.

Instead, I am wondering if I can assign my array
(m_udtIssuer(lngMaxIssuer).sngMarketPrice_CUR) numbers with the information
about different currencies as well. The attribute sngMarketPrice_CUR (SINGLE)
should perhaps be a different data type (CURRENCY?).

Thanks for your help.

"Alan" wrote:

A few questions so we can help you better:

What is the source of your data? An Excel spreadsheet, a CSV file,
or . . . "?

What is the format of this data? For example, is "10 Microsoft - 10
USD" all in one cell or field, or are they in 4 separate fields?

What is your function "sngMarketPrice_CURRENCY(lngRow)" doing? Can
you show us that code?

Are you trying to compute the values in multiple currencies (e.g., USD
and EUR, etc.)?

In general, you have to get the currency from whatever format it is
provided. From there, you can make multiple columns, one for each
currency, or you can have a column that simply designates the currency
(e.g., "USD"). In the first approach, you simply sum up the column.
In the second approach, you have to check the currency before summing
up the number. I would recommend the first approach if the number of
currencies is small. Much cleaner.

Alan

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add new currency Symbol in Format/Cell/Currency NOORZAD Excel Discussion (Misc queries) 2 June 22nd 09 07:59 AM
How to format cells in Excel 2007 (i.e. currency format)? DonR Excel Discussion (Misc queries) 2 May 25th 08 11:16 PM
format cells for currency 2450 and have it format to $24.50? Karen C Excel Worksheet Functions 0 October 13th 05 03:21 PM
why does currency format change to number format? Cassie Excel Discussion (Misc queries) 3 March 18th 05 06:57 PM
Conversion from currency value to currency text format Frank Kabel Excel Programming 1 August 18th 04 10:06 PM


All times are GMT +1. The time now is 12:28 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"