Macros and Variables in formulas

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robokris
    New Member
    • May 2017
    • 1

    Macros and Variables in formulas

    This is the code I am working with and I am very confused on how to insert this into an averaging Formula. I am new to using VB, What I am trying to achieve is each data sheet it is ran on, the data might shift several rows, but I need to pull the same series out for each sheet ex: 22.5 hours +3,-3 hours for 7 data points. I need the 7 data points averaged per sheet. Is there a way to do this?

    Windows(PRGNM). Activate
    Sheets("Raw").S elect

    For I = 5 To 700
    If Cells(I, 2) > 1.49 Then
    Cells(1, 719) = I

    GoTo TestEnd
    End If

    Next
    I1 = I + 3

    TestEnd:
    For I2 = 650 To 700
    If Cells(I2, 2) > 22.49 Then
    Cells(1, 720) = I2

    GoTo Process:
    End If

    Next
    I2 = I - 3
Working...