Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Countif declaration problem with ""word""


Thanks to those who previously helped me with a few problems. Here i
another one.

I am programming a database in which the user can specify a range o
rows that should be used in the formula. For example, the user enter
for beginning row 10 and for ending row 20, where x will be assigned 1
and y will be 20. In the used module the formula goes as follows...

Worksheets("promotion").Range("L22").Formula
"=COUNTIF('Database'!$AR" & x & ":$AR" & y & ","T-shirt")"

Now, the problem lies with the declaration of "T-shirt", where VB
expects the end of some expression. I need - T-shirt <- to appear i
the formula as - "T-shirt" <- .
How would I be able to assign "T-shirt" as a name, so that it does no
cause any conflicts. Thanks for anyone who can give me some advice

--
mpot
-----------------------------------------------------------------------
mpot4's Profile: http://www.excelforum.com/member.php...fo&userid=2741
View this thread: http://www.excelforum.com/showthread.php?threadid=47492

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Countif declaration problem with ""word""

Worksheets("promotion").Range("L22").Formula _
= "=COUNTIF('Database'!$AR" & x & ":$AR" & y & ",""T-shirt"")"

You have to double up those double quotes.

mpot4 wrote:

Thanks to those who previously helped me with a few problems. Here is
another one.

I am programming a database in which the user can specify a range of
rows that should be used in the formula. For example, the user enters
for beginning row 10 and for ending row 20, where x will be assigned 10
and y will be 20. In the used module the formula goes as follows...

Worksheets("promotion").Range("L22").Formula =
"=COUNTIF('Database'!$AR" & x & ":$AR" & y & ","T-shirt")"

Now, the problem lies with the declaration of "T-shirt", where VBA
expects the end of some expression. I need - T-shirt <- to appear in
the formula as - "T-shirt" <- .
How would I be able to assign "T-shirt" as a name, so that it does not
cause any conflicts. Thanks for anyone who can give me some advice.

--
mpot4
------------------------------------------------------------------------
mpot4's Profile: http://www.excelforum.com/member.php...o&userid=27418
View this thread: http://www.excelforum.com/showthread...hreadid=474924


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Countif declaration problem with ""word""

try

Worksheets("promotion").Range("L22").Formula = _
"=COUNTIF('Database'!$AR" & x & ":$AR" & y & ",""T-shirt"")"

"mpot4" wrote:


Thanks to those who previously helped me with a few problems. Here is
another one.

I am programming a database in which the user can specify a range of
rows that should be used in the formula. For example, the user enters
for beginning row 10 and for ending row 20, where x will be assigned 10
and y will be 20. In the used module the formula goes as follows...

Worksheets("promotion").Range("L22").Formula =
"=COUNTIF('Database'!$AR" & x & ":$AR" & y & ","T-shirt")"

Now, the problem lies with the declaration of "T-shirt", where VBA
expects the end of some expression. I need - T-shirt <- to appear in
the formula as - "T-shirt" <- .
How would I be able to assign "T-shirt" as a name, so that it does not
cause any conflicts. Thanks for anyone who can give me some advice.


--
mpot4
------------------------------------------------------------------------
mpot4's Profile: http://www.excelforum.com/member.php...o&userid=27418
View this thread: http://www.excelforum.com/showthread...hreadid=474924


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty "countif"-ing number of "L1" or "L2" on an autofiltered pmdoherty Excel Worksheet Functions 4 February 6th 09 11:23 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"