EZ?- Trying to insert a simple formula using VB

M

Maarkr

I need to code some stuff in Excel before I import it into Access... I can
code vb in Access but get mixed up in Excel:

I want to insert a formula in a cell, but it doesn't like the parens around
unit summary:

Range("O1").Formula = "=COUNTA(A13:A100) -COUNTIF(E13:E100,"Unit Summary")"

Seemed like there were other examples on this site of using "" in a formula
or value? I tried no parens (returns 0 for countif) and tried '. Thx
 
N

Niek Otten

Range("O1").Formula = "=COUNTA(A13:A100) -COUNTIF(E13:E100,""Unit
Summary"")"

Quote within quotes: two quotes
 
J

Jacob Skaria

Try the below (in one line)

Range("O1").Formula = "=COUNTA(A13:A100) -COUNTIF(E13:E100,""Unit Summary"")"

If this post helps click Yes
 
M

Maarkr

so Excel uses dbl quotes instead of single quotes... not like access vb.
Verrrry interesting.
 

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