ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   EZ?- Trying to insert a simple formula using VB (https://www.excelbanter.com/excel-discussion-misc-queries/236199-ez-trying-insert-simple-formula-using-vbulletin.html)

Maarkr

EZ?- Trying to insert a simple formula using VB
 
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

Niek Otten

EZ?- Trying to insert a simple formula using VB
 
Range("O1").Formula = "=COUNTA(A13:A100) -COUNTIF(E13:E100,""Unit
Summary"")"

Quote within quotes: two quotes

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Maarkr" wrote in message
...
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



Jacob Skaria

EZ?- Trying to insert a simple formula using VB
 
Try the below (in one line)

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

If this post helps click Yes
---------------
Jacob Skaria


"Maarkr" wrote:

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


Maarkr

EZ?- Trying to insert a simple formula using VB
 
so Excel uses dbl quotes instead of single quotes... not like access vb.
Verrrry interesting.

"Maarkr" wrote:

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



All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com