Hi i have xl file that contains a two tables of data. (see below) One table contains the names of some datahubs and the other contains sites that connects to the hubs.
Wat i would like to do is to Count the number of sites each datahub has and store that value so it could be reused for other calculations in the vba as showed below. There will never be more then 15 hubs but it could be like 200 sites connecting to diffrent hubs. I have tried to find some thing that will work for this but with out luck.
// OF
[TABLE="width: 500"]
<tbody>[TR]
[TD]Hub
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Hub1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Hub2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Hub3
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sites
[/TD]
[TD]Hub
[/TD]
[/TR]
[TR]
[TD]Site 1
[/TD]
[TD]Hub 1
[/TD]
[/TR]
[TR]
[TD]Site 2
[/TD]
[TD]Hub 1
[/TD]
[/TR]
[TR]
[TD]Site 3
[/TD]
[TD]Hub 2
[/TD]
[/TR]
[TR]
[TD]Site 4
[/TD]
[TD]Hub 3
[/TD]
[/TR]
[TR]
[TD]Site 5
[/TD]
[TD]Hub 2
[/TD]
[/TR]
[TR]
[TD]Site 6
[/TD]
[TD]Hub 3
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Wat i would like to do is to Count the number of sites each datahub has and store that value so it could be reused for other calculations in the vba as showed below. There will never be more then 15 hubs but it could be like 200 sites connecting to diffrent hubs. I have tried to find some thing that will work for this but with out luck.
// OF
[TABLE="width: 500"]
<tbody>[TR]
[TD]Hub
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Hub1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Hub2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Hub3
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sites
[/TD]
[TD]Hub
[/TD]
[/TR]
[TR]
[TD]Site 1
[/TD]
[TD]Hub 1
[/TD]
[/TR]
[TR]
[TD]Site 2
[/TD]
[TD]Hub 1
[/TD]
[/TR]
[TR]
[TD]Site 3
[/TD]
[TD]Hub 2
[/TD]
[/TR]
[TR]
[TD]Site 4
[/TD]
[TD]Hub 3
[/TD]
[/TR]
[TR]
[TD]Site 5
[/TD]
[TD]Hub 2
[/TD]
[/TR]
[TR]
[TD]Site 6
[/TD]
[TD]Hub 3
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Code:
Dim dDegreeInc As Double
Dim dRad As Double
For a = 0 To UBound(here should the data storing number of sites connected to a specific hub be placed)
dDegreeInc = 360 / a
dRad = (dDegreeInc * a) * PI / 180