Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
macro to calculate average on varying sized rows with missing valu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Joel, post: 6397323"] You may wantt to use a UDF macro instead of a sub. Sub RollAverage() Dim role_average As Integer Dim q1_dif_data As Integer Dim q2_dif_data As Integer Dim q3_dif_data As Integer Dim q4_dif_data As Integer Dim q5_dif_data As Integer With Sheets("Data") q1_dif_data = .Cells(65536, "DM").End(xlUp).Row q2_dif_data = .Cells(65536, "DN").End(xlUp).Row q3_dif_data = .Cells(65536, "DO").End(xlUp).Row q4_dif_data = .Cells(65536, "DP").End(xlUp).Row q5_dif_data = .Cells(65536, "DQ").End(xlUp).Row Mytotal = q1_dif_data + q2_dif_data + q3_dif_data + q4_dif_data + q5_dif_data If Mytotal = 5 Then .Cells(role_average, "FF") = Mytotal / 5 End If .Range("FF1") = "Role -- Average" End With End Sub [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
macro to calculate average on varying sized rows with missing valu
Top