Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I enter a Formula into excel using VBA

Status
Not open for further replies.

wimuggs

MIS
Joined
Jan 14, 2005
Messages
2
Location
US
I am trying to have Visual Basic enter a formula into a spreadsheet so I can copy it down a column.

Here is the line in Visual basic:
ActiveCell.FormulaR2C2 = "=CONCATENATE(R1C3," - ",R2C4)"

Whenever I try to run it I get a Run time error 13: Type Mismatch.

Any help would be greatly appreciated.

Thank you
 
try
activecell.formulaR1C1= "=CONCATENATE(R1C3,"" - "",R2C4)"

You need to double quote marks inside a quoted string.
 
Thank you. That resolved the issue.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top