Error 13 Type mismatch help please

jecruz

New Member
Joined
Sep 27, 2011
Messages
9
Hi everyone. I'm developing a program to simulate losses. The error appears on the line for the formula of n.

Random = Rnd()
r = ActiveSheet.Cells(11, 1).Value
s = ActiveSheet.Cells(12, 1).Value
n = WorksheetFunction.LogInv(Random, r, s)

I badly need help. Thanks in advance.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi.
this works for me
ex.
A11=3,5
A12=1,2
Code:
Sub test()
    Dim r, s, n, random As Double
    random = Rnd()
        r = ActiveSheet.Cells(11, 1).Value
        s = ActiveSheet.Cells(12, 1).Value
        n = WorksheetFunction.LogInv(random, r, s)
    MsgBox n
End Sub
 
Last edited:
Upvote 0
Thanks for the reply. I still can't seem to make it work for me. Though I managed to get the results I wanted using the Evaluate function.

Thanks a lot. :D
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,308
Members
449,151
Latest member
JOOJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top