title: Conditional Sum using VBA
body: <p>I want a code in VBA, which will get me a sum for a category (which is displayed as a number), note that this number is changing and not in serial order, as soon as it changes, I want the sum for that particular sub-division. Example- say Towns is a category and Ward is sub category, so my data is displayed as following:<br>
  So lets say the data says that town numbered 100 has 3 wards (1001, 1002, 1003) with their population data,and town numbered 123 has 2 wards (1231, 1232) with their total population data correspondingly, now I want to sum the total population in town 100 and similarly for town 123..and so on.</p>