LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Decimal separators in formulas

I have a VBA application in Excel that puts formulas in various cells. For
example, I need cells that look like this:
=IF(D4=0,0,D3/D4)
This is pretty simple. But in some cases, I need to put an actual number
from a variable.

For example, I have this line of code:
...Cells(A1).Value = "=IF(RC[+3]=0,0," & nMyVar & "/RC[+3])"

If nMyVar = 5, then I get this in cell A1:
=IF(D4=0,0,5/D4)
And if nMyVar = 5.5, I get this in cell A1:
=IF(D4=0,0,5.5/D4)

Again, this is pretty simple.. but for a little thing. Our application runs
on PCs which have different regional settings for the decimal separator. So
for those who use a comma (,) as a separator, the formula becomes:
=IF(D4=0,0,5,5/D4)

As you can see, the number of 'commas' in there will mess up the formula.
When I use RecordMacro to do it manually, it will record it with a period (.)
instead of a comma. But then if I program this, it won't work. Also, the
RecordMacro will use semi-colon (; as the IF(;;) separator... (that's what it
says in Excel's help file).. But again it won't work... My Excel will only
accept commas for the IF (,,) separator.

Any ideas anyone????

Thanks
Somatophylax
 
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
Decimal Points and comma separators Miguel Gamez Excel Discussion (Misc queries) 2 January 23rd 08 02:47 AM
Urgent - make formula work with both decimal separators [email protected] Excel Discussion (Misc queries) 1 October 24th 06 09:52 AM
Can I insert a row that has no column separators? ecodevah Excel Discussion (Misc queries) 2 January 23rd 06 04:22 PM
I need separators on the X axis of a chart. Frank Martin Charts and Charting in Excel 2 January 4th 06 12:32 AM
how to remove separators from numbers lata Excel Discussion (Misc queries) 3 January 9th 05 01:53 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"