Macro Help

How do I make a macro that will make a table with random numbers in it based of user's two inputs?

I know how to do console vb programming with user input and all just cant figure out how to get it to work in corel

Parents
  • Below you can find code that creates grid 5x5 of random numbers between two entered values

    Sub GridOfNumbers2()
        Dim s1 As Shape, startnum As Integer, endnum As Integer, i As Integer, ix As Integer
        Dim ti
        Randomize
        ActiveDocument.Unit = cdrMillimeter
        ActiveDocument.BeginCommandGroup ("numbers")
        startnum = InputBox("Enter 1. number")
        endnum = InputBox("Enter 2. number")
        Optimization = True
        ti = Int(startnum + (startnum * Rnd))
        For i = startnum To (startnum + 4)
        For ix = startnum To (startnum + 4)
        Set s1 = ActiveLayer.CreateArtisticText(0 + x, 290 + y, Format(ti, "000"))
        s1.Fill.UniformColor.CMYKAssign 0, 0, 0, 100
        s1.Outline.SetNoOutline
        x = x + 20
        ti = Int(startnum + ((endnum - startnum) * Rnd))
        Next ix
        x = 0
        y = y - 20
        Next i
        ActiveDocument.BeginCommandGroup ("numbers")
        Optimization = False
        ActiveWindow.Refresh
    End Sub

     

Reply Children