PC Review


Reply
Thread Tools Rate Thread

currency formatting of cells with code

 
 
Harold Good
Guest
Posts: n/a
 
      9th May 2008
Hi, below is the code I have so users from different countries can enter
their currency symbol. e.g $ or £ or ? or "Ksh" (Kenya Shillings), Bht
(Thai Baht), etc.

By them entering their currency symbol (or letter code) into cell M2
(Cells(2, 13)), the Change event fires and it formats a Range
(OtherCurrencyCells), with this format.

It works quite well, but when I try to enter certain letters into M2,
nothing happens. For about 1/3 of letters it will fire, but won't change the
format. E.g. It accepts all the currency symbols I've tried so far, but
when I try to enter "ksh", or "bht", it won't change. But it will change for
"kqr" and some other single and multiletter combinations. I have no idea the
reason or the pattern. It will change for "k", but if I enter "ksh", it only
takes the "k" as the currency format. But if I put any of these
unacceptable ones inside "quotes", it takes them all.

So I guess that could be my solution, to have users enter letter codes for
their currency format, e.g. Ksh, Bht, in double quotes.

But now I'm just plain curious as to why it won't accept certain of these
letters. Any ideas? Thanks, Harold




Private Sub Worksheet_Change(ByVal Target As Range)

Set t = Target
On Error GoTo ErrHandler:
If Intersect(t, Range("A1:z115")) Is Nothing Then Exit Sub
Range("OtherCurrencyCells").NumberFormat = Cells(2, 13).Value & "* #,##0"
Exit Sub
ErrHandler:
End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condition Formatting Code for text in cells =?Utf-8?B?VG9ueQ==?= Microsoft Excel Programming 1 31st Oct 2007 02:44 PM
Excel Formatting Cells Using VB code Andrew Price Microsoft Excel Programming 2 1st Sep 2004 10:58 AM
Problem formatting cells as currency Laura G Microsoft Excel Worksheet Functions 1 2nd Jan 2004 02:24 PM
want euro currency choice when formatting cells in excel 97 carl Microsoft Excel Misc 2 13th Sep 2003 02:22 AM
need euro currency in excel 97 when formatting cells carl Microsoft Excel Misc 1 13th Sep 2003 02:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:45 AM.