<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ocotal.iarc.uaf.edu/index.php?action=history&amp;feed=atom&amp;title=Excel_Macro_Cheap_Windrose</id>
	<title>Excel Macro Cheap Windrose - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ocotal.iarc.uaf.edu/index.php?action=history&amp;feed=atom&amp;title=Excel_Macro_Cheap_Windrose"/>
	<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Excel_Macro_Cheap_Windrose&amp;action=history"/>
	<updated>2026-05-12T19:50:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Excel_Macro_Cheap_Windrose&amp;diff=3817&amp;oldid=prev</id>
		<title>172.18.0.1: Created page with &quot;&lt;pre&gt; Option Explicit Public Sub winddirectionbinning()          Dim inputcol As Integer     Dim outcol As Integer     Dim inputworksheetz As Integer     Dim startrow As Long...&quot;</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Excel_Macro_Cheap_Windrose&amp;diff=3817&amp;oldid=prev"/>
		<updated>2019-07-17T19:38:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; Option Explicit Public Sub winddirectionbinning()          Dim inputcol As Integer     Dim outcol As Integer     Dim inputworksheetz As Integer     Dim startrow As Long...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Option Explicit&lt;br /&gt;
Public Sub winddirectionbinning()&lt;br /&gt;
    &lt;br /&gt;
    Dim inputcol As Integer&lt;br /&gt;
    Dim outcol As Integer&lt;br /&gt;
    Dim inputworksheetz As Integer&lt;br /&gt;
    Dim startrow As Long&lt;br /&gt;
    Dim outputdate As Boolean&lt;br /&gt;
    Dim columnincr As Integer&lt;br /&gt;
    Dim startcol As Integer&lt;br /&gt;
    Dim row As Long&lt;br /&gt;
    Dim yearz&lt;br /&gt;
    Dim monthz&lt;br /&gt;
    Dim WR(0 To 16, 0 To 11), i, j&lt;br /&gt;
    Dim summmm&lt;br /&gt;
    Dim inWScol&lt;br /&gt;
    Dim inWDcol&lt;br /&gt;
    Dim datecol As Integer&lt;br /&gt;
    Dim thiswindspeed, thiswinddirec&lt;br /&gt;
    Dim hdirection, hwindspeed&lt;br /&gt;
    Dim calm&lt;br /&gt;
    For i = 0 To 16&lt;br /&gt;
        For j = 0 To 11&lt;br /&gt;
            WR(i, j) = 0&lt;br /&gt;
        Next&lt;br /&gt;
    Next&lt;br /&gt;
        ' get current wind velocity and direction&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    ' stuff that should be set just initially&lt;br /&gt;
    datecol = 1&lt;br /&gt;
    inputworksheetz = 1&lt;br /&gt;
    row = 5&lt;br /&gt;
    &lt;br /&gt;
    inputcol = startcol&lt;br /&gt;
    inWScol = 2&lt;br /&gt;
    inWDcol = 3&lt;br /&gt;
    outcol = 10&lt;br /&gt;
    outputdate = True&lt;br /&gt;
    summmm = 0&lt;br /&gt;
    &lt;br /&gt;
    Do While Worksheets(inputworksheetz).Cells(row, datecol).Value &amp;lt;&amp;gt; &amp;quot;&amp;quot;&lt;br /&gt;
        monthz = Format(Worksheets(inputworksheetz).Cells(row, datecol).Value, &amp;quot;mm&amp;quot;)&lt;br /&gt;
        thiswinddirec = Worksheets(1).Cells(row, inWDcol).Value&lt;br /&gt;
        thiswindspeed = Worksheets(1).Cells(row, inWScol).Value&lt;br /&gt;
        If monthz &amp;gt;= 6 And monthz &amp;lt;= 8 Then&lt;br /&gt;
            If Abs(thiswinddirec) &amp;lt; 361 And Abs(thiswindspeed) &amp;lt; 50 Then   ' the units here are degrees&lt;br /&gt;
                Select Case thiswinddirec&lt;br /&gt;
                    Case 0 To 22.5 ' 0 to 22.5 degrees&lt;br /&gt;
                        hdirection = 1&lt;br /&gt;
                    Case 22.5 To 45 ' 22.5 to 45 degrees&lt;br /&gt;
                        hdirection = 2&lt;br /&gt;
                    Case 45 To 67.5 ' 45 to 67.5 degrees&lt;br /&gt;
                        hdirection = 3&lt;br /&gt;
                    Case 67.5 To 90 ' etc.&lt;br /&gt;
                        hdirection = 4&lt;br /&gt;
                    Case 90 To 112.5&lt;br /&gt;
                        hdirection = 5&lt;br /&gt;
                    Case 112.5 To 135&lt;br /&gt;
                        hdirection = 6&lt;br /&gt;
                    Case 135 To 157.5&lt;br /&gt;
                        hdirection = 7&lt;br /&gt;
                    Case 157.5 To 180&lt;br /&gt;
                        hdirection = 8&lt;br /&gt;
                    Case 180 To 202.5&lt;br /&gt;
                        hdirection = 9&lt;br /&gt;
                    Case 202.5 To 225&lt;br /&gt;
                        hdirection = 10&lt;br /&gt;
                    Case 225 To 247.5&lt;br /&gt;
                        hdirection = 11&lt;br /&gt;
                    Case 247.5 To 270&lt;br /&gt;
                        hdirection = 12&lt;br /&gt;
                    Case 270 To 292.5&lt;br /&gt;
                        hdirection = 13&lt;br /&gt;
                    Case 292.5 To 315&lt;br /&gt;
                        hdirection = 14&lt;br /&gt;
                    Case 315 To 337.5&lt;br /&gt;
                        hdirection = 15&lt;br /&gt;
                    Case 337.5 To 360&lt;br /&gt;
                        hdirection = 16&lt;br /&gt;
                End Select&lt;br /&gt;
                Select Case thiswindspeed&lt;br /&gt;
                    Case 0 To 0.15 ' 0 to 0.6 meters / second&lt;br /&gt;
                        hwindspeed = 0&lt;br /&gt;
                    Case 0.15 To 2.7&lt;br /&gt;
                        hwindspeed = 1&lt;br /&gt;
                    Case 2.7 To 3.6&lt;br /&gt;
                        hwindspeed = 2&lt;br /&gt;
                    Case 3.6 To 7.2&lt;br /&gt;
                        hwindspeed = 3&lt;br /&gt;
                    Case 7.2 To 8.9&lt;br /&gt;
                        hwindspeed = 4&lt;br /&gt;
                    Case 8.9 To 12.5&lt;br /&gt;
                        hwindspeed = 5&lt;br /&gt;
                    Case 12.5 To 14.5&lt;br /&gt;
                        hwindspeed = 6&lt;br /&gt;
                    Case 14.5 To 20&lt;br /&gt;
                        hwindspeed = 7&lt;br /&gt;
                    Case 20 To 22&lt;br /&gt;
                        hwindspeed = 8&lt;br /&gt;
                    Case 22 To 28&lt;br /&gt;
                        hwindspeed = 9&lt;br /&gt;
                    Case 28 To 31&lt;br /&gt;
                        hwindspeed = 10&lt;br /&gt;
                    Case 31 To 37&lt;br /&gt;
                        hwindspeed = 11&lt;br /&gt;
                    Case Is &amp;gt;= 37&lt;br /&gt;
                        hwindspeed = 9&lt;br /&gt;
                End Select&lt;br /&gt;
                If hwindspeed = 0 Then&lt;br /&gt;
                    calm = calm + 1&lt;br /&gt;
                End If&lt;br /&gt;
                WR(hdirection, hwindspeed) = WR(hdirection, hwindspeed) + 1&lt;br /&gt;
                summmm = summmm + 1&lt;br /&gt;
            End If&lt;br /&gt;
            &lt;br /&gt;
        End If&lt;br /&gt;
        row = row + 1&lt;br /&gt;
    Loop&lt;br /&gt;
    For i = 1 To 16&lt;br /&gt;
        For j = 1 To 11&lt;br /&gt;
            Worksheets(1).Cells(5 + i, outcol + j).Value = WR(i, j) / summmm * 100&lt;br /&gt;
        Next&lt;br /&gt;
    Next&lt;br /&gt;
    Worksheets(1).Cells(22, outcol).Value = calm / summmm * 100&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>172.18.0.1</name></author>
		
	</entry>
</feed>