Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specifying cells in to be checked for data

Status
Not open for further replies.

alekc

Technical User
Nov 3, 2003
3
GB
Hi all

I am currently trying to make a macro in Excel XP to check whether a particular cell contains any data, and if so, add the data to a totals cell.

As the cells are dotted around (although all in the same column) I didn't think it would be pratical to just use normal countif formulae in Excel.

So I turned to our friend VBA, but am unsure how to do it.
The data is only between -2 and +2, and I want to count how many times -2 appears, how many times -1 appears, etc.

The problem is I only want to check certain cells and not the ones in between. For instance, A11, A23, A39, A49 etc.

Any ideas?
 
You're not missing anything, but it's too late on a Friday for me... I'm missing a lot of concentration.

Sorry.
 
Assuming there is SOMETHING in one of the columns that identifies which rows you want to consider while counting, you might be able to use the DCOUNT function with a 2-column criteria range. (One DCOUNT function/criteria range combination for each of the 5 things you are counting.)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top