Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello...I'm sure this is easy but i am new to macros... I am trying to prompt a user with an input box where they will select a range of values. Those values would then be averaged and placed in a cell or a msgbox. Thanks in advance for your help! -- impius1 ------------------------------------------------------------------------ impius1's Profile: http://www.excelforum.com/member.php...o&userid=37671 View this thread: http://www.excelforum.com/showthread...hreadid=572778 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Cant be Done? -- impius1 ------------------------------------------------------------------------ impius1's Profile: http://www.excelforum.com/member.php...o&userid=37671 View this thread: http://www.excelforum.com/showthread...hreadid=572778 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
impius,
Sub DoAverage() Dim myAvg As Double On Error Resume Next myAvg = Application.Average(Application.InputBox( _ "Select the range to average", , , , , , , 8)) MsgBox myAvg Range("A1").Value = myAvg End Sub HTH, Bernie MS Excel MVP "impius1" wrote in message ... Hello...I'm sure this is easy but i am new to macros... I am trying to prompt a user with an input box where they will select a range of values. Those values would then be averaged and placed in a cell or a msgbox. Thanks in advance for your help! -- impius1 ------------------------------------------------------------------------ impius1's Profile: http://www.excelforum.com/member.php...o&userid=37671 View this thread: http://www.excelforum.com/showthread...hreadid=572778 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks! One more question that may make this quite a bit mor difficult. If the user selects a range such as a1:c5, I would like to sum column of the selected range, then sum column c of the selected range...The divide the result of the sum of c by the result of sum of b, and the display final result. I dont know if that is even possible but thanks for your time -- impius ----------------------------------------------------------------------- impius1's Profile: http://www.excelforum.com/member.php...fo&userid=3767 View this thread: http://www.excelforum.com/showthread.php?threadid=57277 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub DoAverageV2()
Dim myAvg As Double Dim myR As Range On Error Resume Next Set myR = Application.InputBox( _ "Select the range to average", , , , , , , 8) If myR.Columns.Count < 3 Then Exit Sub myAvg = Application.Sum(myR.Columns(3)) / _ Application.Sum(myR.Columns(2)) MsgBox myAvg Range("A1").Value = myAvg End Sub HTH, Bernie MS Excel MVP "impius1" wrote in message ... Thanks! One more question that may make this quite a bit more difficult. If the user selects a range such as a1:c5, I would like to sum column b of the selected range, then sum column c of the selected range...Then divide the result of the sum of c by the result of sum of b, and then display final result. I dont know if that is even possible but thanks for your time! -- impius1 ------------------------------------------------------------------------ impius1's Profile: http://www.excelforum.com/member.php...o&userid=37671 View this thread: http://www.excelforum.com/showthread...hreadid=572778 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks so much! -- impius1 ------------------------------------------------------------------------ impius1's Profile: http://www.excelforum.com/member.php...o&userid=37671 View this thread: http://www.excelforum.com/showthread...hreadid=572778 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're welcome!
Bernie MS Excel MVP Thanks so much! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
AVERAGE a range in a column if another column's range equals a val | Excel Discussion (Misc queries) | |||
Average if....between range | Excel Worksheet Functions | |||
average of the range | Excel Programming | |||
Average of a , < range | Excel Worksheet Functions | |||
Average Range | Excel Worksheet Functions |