Hi,
Was tring to work with countif fundtion in VBA for one of my project
In general , my values in the table would be shown as below:
4 columns A, B , C , D as Value , No, Product, Countif.
I need to write a code to count the value column and give the desired result under Countif column
For example, in value column if "2002Apple" is repeated twice in the whole range then it should give the value under Countif as 2.
In excel, we would write Countif(A:A,A2).Please could some one help me in writing the code in VBA for the desired result.
[pre]
[/pre]
Was tring to work with countif fundtion in VBA for one of my project
In general , my values in the table would be shown as below:
4 columns A, B , C , D as Value , No, Product, Countif.
I need to write a code to count the value column and give the desired result under Countif column
For example, in value column if "2002Apple" is repeated twice in the whole range then it should give the value under Countif as 2.
In excel, we would write Countif(A:A,A2).Please could some one help me in writing the code in VBA for the desired result.
[pre]
Code:
A B C D
Value No Product Countif
2002Apple 2002 Apple 2
2002Apple 2002 Apple 2
2002Guava 2002 Grape 1
2002sweet 2002 sweet 1
2006Apple 2006 Apple 2
2006Juice 2006 Juice 1
2006Guava 2006 Guava 1
2006Apple 2006 Apple 1
2006sweet 2006 sweet 1
2007Apple 2007 Apple 1
2007Juice 2007 Juice 1