usercenter93
New Member
- Joined
- Apr 22, 2015
- Messages
- 9
Hello,
i have created a programm that asks for an input Column and then creates an average of the 60 values and then next 60 values and so on. I want that insteas of input of Column(A,B) I will input the variable with which the column have been named , like the column L have been named as Power. so i input power instead of L .
Sub Hourlyaverage()
Dim i As Long, j As Long, k As Long
Dim myRange As Range
Dim myValue As Variant
Sheets("DUT1_Test51_excel").Select
i = 3
j = 3
k = 63
myValue = InputBox("Give Column name to calculate Average eg. A,B")
Do While Cells(i, 12).Value <> ""
Set myRange = Range(myValue & i & ":" & myValue & k)
Cells(j, 20).Value = Application.Average(myRange)
i = i + 60
j = j + 1
k = k + 60
Loop
End Sub
i have created a programm that asks for an input Column and then creates an average of the 60 values and then next 60 values and so on. I want that insteas of input of Column(A,B) I will input the variable with which the column have been named , like the column L have been named as Power. so i input power instead of L .
Sub Hourlyaverage()
Dim i As Long, j As Long, k As Long
Dim myRange As Range
Dim myValue As Variant
Sheets("DUT1_Test51_excel").Select
i = 3
j = 3
k = 63
myValue = InputBox("Give Column name to calculate Average eg. A,B")
Do While Cells(i, 12).Value <> ""
Set myRange = Range(myValue & i & ":" & myValue & k)
Cells(j, 20).Value = Application.Average(myRange)
i = i + 60
j = j + 1
k = k + 60
Loop
End Sub