Writing special character (eg. !) to excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • donpur
    New Member
    • Nov 2009
    • 2

    #1

    Writing special character (eg. !) to excel

    In Visual Basic I am attempting to write a formula that includes an explanation point out to an Excel cell. When I do, Excel puts extra single quotes into the formula. For example the following: ActiveCell.Form ulaR1C1 = "='Pricing - SIPs'!AE84+'Pri cing - Circuits'!AN83" writes the following into the cell: ='Pricing - SIPs'!'V84'+'Pr icing - Circuits'!'Y83'

    An extra set of single quotes gets placed around the cell reference V84 and Y83 causing an error statement in Excel.

    How can I avoid this inclusion of extra quotes, or get rid of them?

    Thanks a million!
    Last edited by donpur; Nov 2 '09, 03:24 PM. Reason: typo
  • MikeTheBike
    Recognized Expert Contributor
    • Jun 2007
    • 640

    #2
    Originally posted by donpur
    In Visual Basic I am attempting to write a formula that includes an explanation point out to an Excel cell. When I do, Excel puts extra single quotes into the formula. For example the following: ActiveCell.Form ulaR1C1 = "='Pricing - SIPs'!AE84+'Pri cing - Circuits'!AN83" writes the following into the cell: ='Pricing - SIPs'!'V84'+'Pr icing - Circuits'!'Y83'

    An extra set of single quotes gets placed around the cell reference V84 and Y83 causing an error statement in Excel.

    How can I avoid this inclusion of extra quotes, or get rid of them?

    Thanks a million!
    Hi

    Try this
    Code:
    ActiveCell.Formula = "='Pricing - SIPs'!AE84+'Pricing - Circuits'!AN83"
    ie, omit R1C1 (this is not in R1C1 format formula!)


    MTB

    Comment

    Working...