G
Guest
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"")"
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"")"