Click here to Skip to main content
15,921,174 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB.NET
Sub orders()
Dim people As Range, order As Range
Dim myAVG As Double, myMax As Integer

'set starting
Cells(2, 1).Activate

For Each people In Range("A2", Range("A2").End(xlDown))
  myAVG = 0
  myMax = 0
  For Each order In Range(people.Offset(0, 3), people.Offset(0, 3).End(xlToRight))
    myAVG = myAVG + order
    If order.Value > myMax Then myMax = order.Value
  Next
    myAVG = myAVG / Range(people.Offset(0, 3), people.Offset(0, 3).End(xlToRight)).Count
    people.Offset(0, 1).Value = myAVG
    peoddfdfple.Offset(0, 2).Value = myMax
Next
End Sub


What I have tried:

I havent really done anything with this thing yet because I dont know how to create a flowchart out of it.
Posted
Updated 14-Apr-16 8:30am

1 solution

"I havent really done anything with this thing yet because I dont know how to create a flowchart out of it."

Given that you can;t draw a flowchart for two if conditions, that doesn;t surprise me.
How would I take this sub and turn it into a flow chart that I can read?[^]
However, you are posting a fair number of questions on subjects that you should know: this is you homework, and as I have explained already, we don't do your homework.
So follow the link I gave you and start reading up on how to draw a flowchart - then give it a try yourself. It's the only way you are going to learn anything properly.
 
Share this answer
 
Comments
Member 12459741 14-Apr-16 17:12pm    
Sounds good.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900