Results 1 to 4 of 4

How to remove a space before the "=" sign and make the formula works properly?

Threaded View

  1. #1
    Registered User
    Join Date
    03-16-2010
    Location
    Brasil
    MS-Off Ver
    Excel 2003
    Posts
    7

    How to remove a space before the "=" sign and make the formula works properly?

    Hello People,

    I've created a simple macro to copy-paste the trendline formula from my chart to a cell. After that I replaced the polynoms by specific reference cells which have values.

    My issue is that my formulas which came from the trendline do not give me the numerical value result. They work as text, even when I change the format to numerical. A better look showed me that it had a space before the "=" sign formula avoinding me to get the result.

    To get the answer I have to press F2 and enter, but as I have several cells like this is hard every single time press F2+enter.

    I tried to use this simple macro to solve the issue, but it seems the code does not work when I use a reference cell in the formula, because it keeps giving me a 1004 run time error.

    the code is

    Sub ConvertingFormulaBack()
    
        Dim X As Variant
        X = Range("p14")
        X = Replace(X, " ", "", 1, 75)
        Range("p14") = X
        
    End Sub

    I hope I've made myself clear.

    Thanks in advance

    Leo
    Last edited by Leosado; 04-19-2010 at 02:45 PM.

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