formula using vba does not work ..

B

bbubble62

Hi,

In a spreadsheet I insert a very simple formula :

Range("I1").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(A:A,""*"")"
Range("I2").Select

Cell I1 gives an error #NAME?, but when selecting this cell, put
cursor after last char and press enter, the right value appears ! So i
did NOT modify it only place cursor and hit enter ...

Any thoughts ?

-ben
 
C

Chip Pearson

Use ActiveCell.Formula rather than ActiveCell.FormulaR1C1. E.g,.


ActiveCell.Formula = "=COUNTIF(A:A,""*"")"

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top