Community discussion forum

The MOD problem

  • 2 years ago
    we  are trying to find mod of a variable whose value varies between
    321272406 to 8353082565 , but it is giving RunTime error6 , overflow
    we have declared our variable as currency.

    The statement is like:

            dp= (v4 MOD 6)
     where v4 is the variable






    whose value varies between
    321272406 to 8353082565
  • 2 years ago

    Hi,

    The below will work if I understand what you meant

    Dim x As Currency ' or double

    Private Sub Command1_Click()

        For x = 321272406 To 8353082565#
       
            If x Mod 6 = 0 Then MsgBox x : Exit Sub
       
        Next



    End Sub

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!