Connecting Tech Pros Worldwide Forums | Help | Site Map

Writing special character (eg. !) to excel

Newbie
 
Join Date: Nov 2009
Posts: 2
#1: 3 Weeks Ago
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.FormulaR1C1 = "='Pricing - SIPs'!AE84+'Pricing - Circuits'!AN83" writes the following into the cell: ='Pricing - SIPs'!'V84'+'Pricing - 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!

Expert
 
Join Date: Jun 2007
Location: Derbyshire, UK
Posts: 347
#2: 3 Weeks Ago

re: Writing special character (eg. !) to excel


Quote:

Originally Posted by donpur View Post

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.FormulaR1C1 = "='Pricing - SIPs'!AE84+'Pricing - Circuits'!AN83" writes the following into the cell: ='Pricing - SIPs'!'V84'+'Pricing - 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
Expand|Select|Wrap|Line Numbers
  1. ActiveCell.Formula = "='Pricing - SIPs'!AE84+'Pricing - Circuits'!AN83"
ie, omit R1C1 (this is not in R1C1 format formula!)


MTB
Reply