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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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,224,550
Messages
6,179,459
Members
452,915
Latest member
hannnahheileen

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