Excel Macro Snow Algo
Jump to navigation
Jump to search
Option Explicit Private Sub snowtest() ' column A = Date ' column C = Raw Data ' column D = Dim columnDate As Integer Dim columnSDC As Integer Dim columnINFIL As Integer Dim columnADD As Integer Dim columnDEL As Integer Dim currow As Long Dim futureoffset As Long Dim curinfilval As Double Dim nextinfilval As Double Dim curSDCval As Double Dim futureSDCval As Double columnDate = 1 columnDEL = 4 columnADD = 5 columnSDC = 6 columnINFIL = 8 currow = 5436 futureoffset = 18 * 12 ' (12 measurements per hour, offset is +18 hours) Do While Worksheets(1).Cells(currow, columnADD).Value <> "end of season" curinfilval = Worksheets(1).Cells(currow, columnINFIL).Value nextinfilval = Worksheets(1).Cells(currow + 1, columnINFIL).Value curSDCval = Worksheets(1).Cells(currow, columnSDC).Value futureSDCval = Worksheets(1).Cells(currow + futureoffset, columnSDC).Value Loop End Sub