0% found this document useful (0 votes)
25 views1 page

MSVBA Program

The provided VBA code defines a subroutine named 'averger' that calculates the average of values in specified ranges of column B. It dynamically determines the last row with data and averages every 60 rows, starting from row 2. The results are displayed in sequential rows of column B based on the calculated averages.

Uploaded by

freeware
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

MSVBA Program

The provided VBA code defines a subroutine named 'averger' that calculates the average of values in specified ranges of column B. It dynamically determines the last row with data and averages every 60 rows, starting from row 2. The results are displayed in sequential rows of column B based on the calculated averages.

Uploaded by

freeware
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COde VBA

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

l = [Link](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 = [Link](Range(rng))
x = y + 1
y = y + 60
Next j

End Sub

Page 1

You might also like