Results 1 to 5 of 5

Decimal Sign Replaced with ; Sign

Threaded View

  1. #1
    Registered User
    Join Date
    11-23-2009
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    32

    Decimal Sign Replaced with ; Sign

    Hi to all,

    I'm trying to solve a strange problem in a piece of code.
    I have a variable that is define as Double called STD. When i try to insert that variable in a formula the decimal sign (for me a comma "," because I'm Portuguese) gets converted to ";" (which is for me the separation sign for the expressions in excel formulas. ex: AND(A1>0;B1>0)=TRUE). The code is:

    Public STD as Double
    STD = ActiveSheet.Cells(n, NUMBEROFASSETS + 5).Value
    ActiveSheet.Cells(m + 1, n + TOPPAIRS + NUMBEROFASSETS + 7).Formula = "=IF(AND(INDEX(" & SPREAD & "," & m + 1 & "," & n & ")>" & STD & "," & ANT & "=0)=TRUE,-1,IF(AND(INDEX(" & SPREAD & "," & m + 1 & "," & n & ")<-" & STD & "," & ANT & "=0)=TRUE,1,IF(AND(" & ANT & "<>0,SIGN(INDEX(" & SPREAD & "," & m + 1 & "," & n & "))<>SIGN(INDEX(" & SPREAD & "," & m & "," & n & ")))=TRUE,0,IF(AND(" & ANT & "<>0,INDEX(" & SPREAD & "," & m + 1 & "," & n & ")="""")=TRUE,0,IF(" & ANT & "<>0," & ANT & ",0)))))"
    Can anyone help me preventing this automatic conversion?
    Thanks in advance for any advice.

    Edit: I must add, i have tried to convert the sign before using the variable in the formula but with no success. I tried this:
    STD = SUBSTITUTE(STD,"","",""."")
    Last edited by lopiner; 12-10-2009 at 08:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1