PC Review


Reply
Thread Tools Rate Thread

Break this down...

 
 
=?Utf-8?B?Q1YzMjM=?=
Guest
Posts: n/a
 
      15th Mar 2007
I came upon this formula with a 'record macro'. It worked for what I needed
to get done, but could someone break it down for me because it's confusing
and I'd like to use it for another report and also to expand to at least two
more columns with different criteria.

Basically what I did was, put my cursor on the field where the results would
go, and =countif, went into the second workbook to column P, selected the
column and typed in the criteria. It worked fine, I'm trying to do this for
another report and can't figure out what this formula really reads like. The
confusing part is the what's in between the brackets [] and that it has 'C'
instead of 'P', which is where the info came from. Thanks in advance.

Range("E6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[11],""Austria"")"
Range("F6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[10],""Belgium"")"
Range("G6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[9],""Germany"")"
Range("H6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[8],""Ireland"")"
Range("I6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[7],""Italy"")"
Range("J6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[6],""Luxembourg"")"
Range("K6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[5],""Netherlands"")"
Range("L6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[4],""Switzerland"")"
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      15th Mar 2007
Your formula is in R1C1 mode meaning that it uses the relative row and column
number to address your cells. C[11] is column 11. So column P is 11 columns
over from cell E6...
--
HTH...

Jim Thomlinson


"CV323" wrote:

> I came upon this formula with a 'record macro'. It worked for what I needed
> to get done, but could someone break it down for me because it's confusing
> and I'd like to use it for another report and also to expand to at least two
> more columns with different criteria.
>
> Basically what I did was, put my cursor on the field where the results would
> go, and =countif, went into the second workbook to column P, selected the
> column and typed in the criteria. It worked fine, I'm trying to do this for
> another report and can't figure out what this formula really reads like. The
> confusing part is the what's in between the brackets [] and that it has 'C'
> instead of 'P', which is where the info came from. Thanks in advance.
>
> Range("E6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[11],""Austria"")"
> Range("F6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[10],""Belgium"")"
> Range("G6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[9],""Germany"")"
> Range("H6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[8],""Ireland"")"
> Range("I6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[7],""Italy"")"
> Range("J6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[6],""Luxembourg"")"
> Range("K6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[5],""Netherlands"")"
> Range("L6").Select
> ActiveCell.FormulaR1C1 = "=COUNTIF(ISCE!C[4],""Switzerland"")"

 
Reply With Quote
 
=?Utf-8?B?Q1YzMjM=?=
Guest
Posts: n/a
 
      15th Mar 2007

Ok makes sense now. I was confused on that C.

I realized that I got the info while the sheets were on the same workbook.

What if the info is in another workbook? It comes back saying that I
entered too few arguments. Is it not possible to "=countif" with the data in
two separate workbooks?
 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      15th Mar 2007
Did you record a macro to add the reference to the new workbook or did you
try to modify the code that you have? In either case post the code that you
have...

If you want to do a CountIf to a seperate workbook I think you might run
into an issue if the externally referenced workbook is closed because CountIf
doe not like referencing closed books. Take a look at this web site...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
--
HTH...

Jim Thomlinson


"CV323" wrote:

>
> Ok makes sense now. I was confused on that C.
>
> I realized that I got the info while the sheets were on the same workbook.
>
> What if the info is in another workbook? It comes back saying that I
> entered too few arguments. Is it not possible to "=countif" with the data in
> two separate workbooks?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL2003 VBA: Debuging...can not break or run in break/step mode. Conan Kelly Microsoft Excel Programming 1 23rd Aug 2008 11:51 AM
Word 2007 - Where is Insert | Break | Text Wrapping Break? EDembicki Microsoft Word Document Management 5 12th Jul 2008 07:28 PM
Re: Word 2003 Section Break Page Break Chad DeMeyer Microsoft Word Document Management 0 11th Aug 2004 06:40 PM
Re: Word 2003 Section Break Page Break Bill Foley Microsoft Word Document Management 0 11th Aug 2004 06:39 PM
add page break code in csv file to force break when loading. tim Microsoft Excel Misc 3 1st Apr 2004 01:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:51 AM.