#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default range names

Hi, If Ive called a1:a10 "home" and b1:b10 "result". Then in vba Ive
used ' X = Application.WorksheetFunction.CountIfs(Range("home "),
"Norwich", Range("result"), "H") ' which works perfect. What ive been
trying though is to call a1:b10 AllData, then refer to the colums. Im
trying this because in reality my table of data is infact alot bigger.
Ive got as far as Range("AllData").column(2).select which works. Been
trying X =
Application.WorksheetFunction.CountIfs(Range("AllD ata").columns(1),
"Norwich", Range("AllData").columns(2), "H"). Can this be done, or do
I name my columns seperatly. Thankyou
Regards Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default range names

CountIf can work on multiple columns. If the result you want is the
count over the entire range, no change is needed. If the result you
want is the count for only one column within the range, then make
CountIf's first argument, for example,
Range("home").Offset(0,0).Resize(10,1) for the first column, or
Range("home").Offset(0,1).Resize(10, 1) for the second column.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default range names

CountIf can work on multiple columns. To get the result for the entire
range, no change is needed. To get the result for only one column
within the range, then make CountIf's first argument, for example,
Range("home").Offset(0,0).Resize(10,1) for the first column, or
Range("home").Offset(0,1).Resize(10,1) for the second column.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default range names

On Feb 5, 5:43*am, RobcPettit wrote:
Hi, If Ive called a1:a10 "home" and b1:b10 "result". Then in vba Ive
used ' X = Application.WorksheetFunction.CountIfs(Range("home "),
"Norwich", Range("result"), "H") ' which works perfect. What ive been
trying though is to call a1:b10 AllData, then refer to the colums. Im
trying this because in reality my table of data is infact alot bigger.
Ive got as far as Range("AllData").column(2).select which works. Been
trying X =
Application.WorksheetFunction.CountIfs(Range("AllD ata").columns(1),
"Norwich", Range("AllData").columns(2), "H"). Can this be done, or do
I name my columns seperatly. Thankyou
Regards Robert


Suggest making a defined name for the range you want and then apply
the formula. BTW, you should use only application.ccc dropping the
"worksheetfunction" part
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default range names

Thankyou both for your reply's. I thing I will make defined names for
the ranges.
Regards Robert
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
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
Create range names with names in column heading NigelVII Excel Programming 2 July 29th 08 11:53 AM
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES Bricol Excel Discussion (Misc queries) 0 July 8th 08 03:54 PM
Is there a way to give range names (especially with relative reference) for series names and series values in Excel 2007 graphs? [email protected] Excel Programming 0 August 16th 07 02:52 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM


All times are GMT +1. The time now is 05:02 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"