View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] stephentebaldi@gmail.com is offline
external usenet poster
 
Posts: 13
Default Error 13...Mismatch

Can anyone clarify this? I have a variable named in my macro (aveemax)
and I am trying to divide a range by this number. I would imagine it's
possible to divide a range by a single number, but I would also imagine
that this error means that it doesn't want to do this. The code in
question is below.

Worksheets("Sheet1").Activate
Dim TempGPCR1 As Range
Dim GPCR1data As Range
Dim i As Long
For i = 1 To numCpd1
Worksheets("Sheet1").Activate
Set TempGPCR1 = Application.InputBox("Please Select Data
for Compound " & i, Type:=8)
Worksheets("Sheet3").Activate
Range("A" & i + 1) =
Application.WorksheetFunction.Average(TempGPCR1(i) )
Next i

Worksheets("Sheet1").Activate
Dim Emax1 As Range
Set Emax1 = Application.InputBox("Please Select Data for
Emax", Type:=8)

aveemax1 = WorksheetFunction.Average(Emax1)
Worksheets("Sheet3").Activate
[H8].Value = aveemax1

Dim r1 As Range
Set r1 = aveemax1 * TempGPCR1

Is there just something wrong with my code? I have tried it numerous
ways and it always gives me this mismatch error.