I am fairly new to the world of VB and am having a problem that I can't seem to figure out.
I have a large data file that changes in size and number on a daily basis. I have three columns that contains a numerical amount that I sum up and then a series of columns with text where I am trying to count the number of times an "X" appears. I then get the sum of the numerical and text columns together. I was originally using a formula with COUNTA for the text section but discovered that since the info is coming from a .CSV file that there is hidden text that is being counted and returning an incorrect number. Here is my original code:
I tried changing it to a COUNTIF so that it will only return the amount of spaces containing an "X" but the new code always gives an error that says:
The new formula I am attempting to use is:
What am I doing wrong???
I have a large data file that changes in size and number on a daily basis. I have three columns that contains a numerical amount that I sum up and then a series of columns with text where I am trying to count the number of times an "X" appears. I then get the sum of the numerical and text columns together. I was originally using a formula with COUNTA for the text section but discovered that since the info is coming from a .CSV file that there is hidden text that is being counted and returning an incorrect number. Here is my original code:
Code:
ActiveCell.FormulaR1C1 = "=SUM(RC[8]:RC[10])+COUNTA(RC[11]:RC[25])"
I tried changing it to a COUNTIF so that it will only return the amount of spaces containing an "X" but the new code always gives an error that says:
HTML:
Compile error: Unexpected: end of statement
The new formula I am attempting to use is:
Code:
ActiveCell.FormulaR1C1 = "=SUM(RC[8]:RC[10])+COUNTIF(RC[11]:RC[25],"X")"
What am I doing wrong???