Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All, I am trying to get an average of a set of data input by operator. I am not familiar with cyntax for average of the range.. Sub Average() Dim mynum As Integer Dim lRow As Integer Dim Arange As Range ActiveSheet.Range("A2").Value = InputBox("No. Pls?") 'ActiveSheet.cell("A2").Value = mynum ActiveSheet.Range("A2").Select Selection.Copy Range("A3").Select Selection.Insert Shift:=xlDown lRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row Now I want to say at the last row to do an average of the whole rang which starts from cell A2 Appreciate your help. Thank you syed Azi -- sazi ----------------------------------------------------------------------- saziz's Profile: http://www.excelforum.com/member.php...nfo&userid=635 View this thread: http://www.excelforum.com/showthread.php?threadid=50269 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim lRow as long
with activesheet lRow = .Cells(.Rows.Count, 1).End(xlUp).Row .cells(lrow+1,1).formular1c1 = "=sum(r2c:r[-1]c)" end with (one of the nice things about using the .formular1c1) saziz wrote: Hi All, I am trying to get an average of a set of data input by operator. I am not familiar with cyntax for average of the range.. Sub Average() Dim mynum As Integer Dim lRow As Integer Dim Arange As Range ActiveSheet.Range("A2").Value = InputBox("No. Pls?") 'ActiveSheet.cell("A2").Value = mynum ActiveSheet.Range("A2").Select Selection.Copy Range("A3").Select Selection.Insert Shift:=xlDown lRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row Now I want to say at the last row to do an average of the whole range which starts from cell A2 Appreciate your help. Thank you syed Aziz -- saziz ------------------------------------------------------------------------ saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350 View this thread: http://www.excelforum.com/showthread...hreadid=502698 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you Dave. One more thing I added to my list of "things learnt today" using the .formular1c1.. Thanks Syed -- saziz ------------------------------------------------------------------------ saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350 View this thread: http://www.excelforum.com/showthread...hreadid=502698 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
average if - between range | Excel Worksheet Functions | |||
Average last 3 in range | Excel Worksheet Functions | |||
AVERAGE a range in a column if another column's range equals a val | Excel Discussion (Misc queries) | |||
Average of a , < range | Excel Worksheet Functions | |||
Average Range | Excel Worksheet Functions |