ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Formating (https://www.excelbanter.com/excel-programming/301542-conditional-formating.html)

David

Conditional Formating
 
I have a number of textboxs, which display formated
numbers and currency symbols. I would like to expand my
worksheet to include other currencies, like ?, ¢, £, etc.

I know that I can set up if then statments to account for
users selection of currency, however, That involves an
aweful lot of duplicate code considering the number of
textboxes, and the currencies i would like to support.

the formatted text line looks like this

TBPrt.Text = Format(Worksheets("pricing").Range
("ad4"), "$##,##0.00")

Is there an easy way for me to have that currency symbol
be variable based on user selection of currency on the
title page. Any assistance on an easier way than just
doing if then statements would be greatly appreciated.

Thanks
Dave

Bob Phillips[_6_]

Conditional Formating
 
David,

If I understand correctly, could you not setup a module level variable for
the currency format. Something like

ccyFormat = ccyId & "#,###,##0.00"

where ccyId is the selected currecncy symol, £, $ or whatever, and then use
like

TBPrt.Text = Format(Worksheets("pricing").Range("ad4"), ccyFormat)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"David" wrote in message
...
I have a number of textboxs, which display formated
numbers and currency symbols. I would like to expand my
worksheet to include other currencies, like ?, ¢, £, etc.

I know that I can set up if then statments to account for
users selection of currency, however, That involves an
aweful lot of duplicate code considering the number of
textboxes, and the currencies i would like to support.

the formatted text line looks like this

TBPrt.Text = Format(Worksheets("pricing").Range
("ad4"), "$##,##0.00")

Is there an easy way for me to have that currency symbol
be variable based on user selection of currency on the
title page. Any assistance on an easier way than just
doing if then statements would be greatly appreciated.

Thanks
Dave




All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com