Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88066

VBA sin() and cos() trouble

$
0
0

Im trying to make some VBA form and to calculate some simple values but I dont understand why VBA dosen't recognize Sin() and Cos() functions. For example: I wrote int() and VBA transformed it into Int(), but it doesn't do the same with sin and cos. Moreover, after I'm trying to compile my code

    Private Sub btn_exit_Click()
    Unload laborator_2
End Sub

Private Sub btn_start_Click()
    today.Caption = Date
    rnb_val.Caption = Int(Rnd * 90 + 1)
    sqrt_val.Caption = Sqr(rnb_val.Caption)
    si_val.Caption = sin(rnb_val.Caption * 3.14159 / 180)
    co_val.Caption = rnb_val.Caption * 3.1459 / 180
End Sub

I got this message:

Run-time error "424" Object required

enter image description here

Im new in VBA, so sorry if I didn't write all details. Thank you.


Viewing all articles
Browse latest Browse all 88066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>