ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Magical appearance of single quotes. (https://www.excelbanter.com/excel-programming/279736-magical-appearance-single-quotes.html)

Dean Corda

Magical appearance of single quotes.
 
This line is used in my code:
Selection.FormulaR1C1 = "=COUNTIF(G2:G" & vDiff
& ",""Regular"")"

The problem is that somehow I get this on the worksheet:
=COUNTIF('G2':'G4',"Regular") <-- single quotes around the
elements of the range.

How can I write the line so the single quotes do not
appear?

Any help will be appreciated.

Dean.

Don Guillett[_4_]

Magical appearance of single quotes.
 
First, try deleting the R1C1 part of your code
BTW, you do NOT have to select to place the formula. You could use
range("b3").Formula = "=COUNTIF(G2:G" & vDiff & ",""Regular"")"

"Dean Corda" wrote in message
...
This line is used in my code:
Selection.FormulaR1C1 = "=COUNTIF(G2:G" & vDiff
& ",""Regular"")"

The problem is that somehow I get this on the worksheet:
=COUNTIF('G2':'G4',"Regular") <-- single quotes around the
elements of the range.

How can I write the line so the single quotes do not
appear?

Any help will be appreciated.

Dean.




Dean Corda

Magical appearance of single quotes.
 
Thanks for the help, Don. I'm still waiting for this post
to show up in the web view...I used the search to find it.

-----Original Message-----
First, try deleting the R1C1 part of your code
BTW, you do NOT have to select to place the formula. You

could use
range("b3").Formula = "=COUNTIF(G2:G" & vDiff

& ",""Regular"")"

"Dean Corda" wrote in message
...
This line is used in my code:
Selection.FormulaR1C1 = "=COUNTIF(G2:G" & vDiff
& ",""Regular"")"

The problem is that somehow I get this on the worksheet:
=COUNTIF('G2':'G4',"Regular") <-- single quotes around

the
elements of the range.

How can I write the line so the single quotes do not
appear?

Any help will be appreciated.

Dean.



.



All times are GMT +1. The time now is 04:03 AM.

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