Thread: VBA Formulas
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sandy Sandy is offline
external usenet poster
 
Posts: 270
Default VBA Formulas

Hi
I have a situation where I would like to Sum, Average, etc entirely within
VBA
eg

Dim CountCol As Integer
Dim AvScore As Single

CountCol=Worksheets("Search").Evaluate("ROWS(H8:H3 00)-COUNTBLANK(H8:H300)")

'Would this be even close for the next bit? (Which I know is wrong)

AvScore=Worksheets("Search").Evaluate("AVERAGE(8, 11):(8+CountCol, 11)")

'The result from this is then allocated to a particular cell

Sheets("Sheet1").Range("A11").Value = AvScore

Thanks in advance
Sandy