View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
phil-rge-ee phil-rge-ee is offline
external usenet poster
 
Posts: 18
Default Help with VB code - average of numbers over specified weeks

I have a spreadsheet that has weeks 1-9 (columns C-K). In each week is 3
numbers (rows 4-6). Those numbers get added together to get a total for that
week (row 7).
I need help with creating the VB script that when run adds the totals
together and gives an average for a specified week range.

Example: user clicks a button and a dialog box comes up where they enter in
the week range in textboxes. So textbox1.text could be 3 and textbox2.text
could be 7. Then the user clicks an ok button and the script runs. The script
would add together the totals for week 3,4,5,6,7 (in row 7) then divide that
sum by: number of weeks x 3 (in this case 15)
Another example: user enters in week 6 to week 9, they click ok and the
script runs. It would add the totals for week 6,7,8,9 then divide that sum
by: number of weeks x 3 (in this case 12)

The week range will be different all the time, depending on what specified
week average I need at that time. Can anyone help me with this?

Thanks for any help you can provide,
Phil