Option Explicit
Dim x, y As Integer '<---- Aqui "x" es variant y "y" es Integer. Si quieres decir que las dos son Integer, haz asi: Dim x as integer, y as integer
Private Sub cmdComenzar_Click()
x = CInt(Rnd() * (9 - 1) + 1)
End Sub
Private Sub cmdComparar_Click()
txty = y '<--- inicialmente "y" vale cero (0), el valor en el txty es el que el usuario digita pero éste es borrado por el valor de y = 0 (aqui hay un error de tu logica). Si yo fuera tu, yo haria en esta linea: y = txty
If x > y Then MsgBox " Intente de nuevo el numero es Mayor"
If x < y Then MsgBox " Intente de nuevo el numero es Memor"
else x = y Then MsgBox "Enhorabuena aceptaste vuelve a jugar" '<--- Error. Comando Else de una sola linea? y que incluye una condicion? (No confundas con el "Elseif"), te recomiendo estudiar mas el if ... then .... else... [end if]
End Sub
Private Sub cmdLimpiar_Click()
txty = Empty
txty.SetFocus
End Sub
Private Sub Form_Activate()
Randomize
cmdLimpiar.Enabled = False
cmdComparar.Enabled = False
End Sub
Private Sub txty_Change()
cmdLimpiar.Enabled = True
cmdComparar.Enabled = True
End Sub