using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

Private Sub CommandButton1_Click()
For i = 1 To 9
Cells(1, i) = i
Cells(1, i).Font.ColorIndex = 0
Next
Cells(3, 1) = Fix(Rnd() * 9 + 1)
Switch
For j = 1 To 9
i = 10 - j
Cells(3, 1) = Fix(Rnd() * i + 1)
a = Cells(1, Cells(3, 1))
Cells(1, Cells(3, 1)) = Cells(1, i)
Cells(1, i) = a
Next
End Sub


