0% found this document useful (0 votes)
8 views

MSVBA Program

MS VBA program sample excel

Uploaded by

freeware
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

MSVBA Program

MS VBA program sample excel

Uploaded by

freeware
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

COde VBA

Sub averger()
Dim i, j, x, y As Integer
Dim rows, cols, rng
x = 2
y = 60
Dim l As Long

l = Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
MsgBox l
For j = 2 To Round(((l - 2) / 60), 0)
rows = "B" & x
cols = "B" & y
rng = rows & ":" & cols
Range("B" & j).Value = Application.WorksheetFunction.Average(Range(rng))
x = y + 1
y = y + 60
Next j

End Sub

Page 1

You might also like