LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Some more help with code...Averaging a range

So this is my code:

Worksheets("Sheet1").Activate
Dim rTmpRange As Range
Dim sRefAnt() As String
Dim numGPCR As Long
Dim ref As Long
numGPCR = InputBox("Enter the Number of GPCRs Tested")
ReDim sRefAnt(1 To numGPCR)
For ref = 1 To numGPCR
Set rTmpRange = Application.InputBox("Please Select Data for
Reference Antagonist " & ref, Type:=8)
sRefAnt(ref) = rTmpRange.Address
Next

Dim RefAnt As Range
RefAnt() = WorksheetFunction.Average(sRefAnt) 'This averages the
Reference antagonist values for calculation
Worksheets("Sheet2").Activate
Range("F" & ref) = RefAnt()

I am trying to be able to put in 2+ ranges in line 6 and then average
those ranges individually later on (in RefAnt) is this possible to do?
and if so is it just the way I am defining my RefAnt variable? Do I
need to let excel know that I want it to go from 1 to numGPCR?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
averaging a range suprsonic Excel Worksheet Functions 5 May 6th 10 04:15 AM
Averaging times that are not in a range Nancy D Excel Worksheet Functions 3 April 20th 10 05:19 PM
VBA code for averaging a range of cells kayard[_8_] Excel Programming 1 August 9th 06 11:21 AM
Averaging a range in VBA WilMar Excel Programming 4 November 17th 04 04:14 PM
Averaging a dynamic range...Help ??? wraithlead Excel Programming 1 July 9th 04 02:36 PM


All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"