нужна помощь по Visual Basic (VBA)
Имеется поле из 36 клеток - 6х6 (Label1 ...Label36) с типом данных Integer от 1 до 9, сгенерированных случайным образом в каждой клетке (на всем поле каждая цифра повторяется 4 раза)
каждая клетка закрыта соответствующей кнопкой (CommandButton1 ...CommandButton36)
если при последовательном нажатии на два CommandButton'а (заранее неизвестно какие) , цифры под ними у Label'ов окажутся одинаковыми, то эти Label'ы становятся невидимыми, если - цифры будут НЕдинаковыми, то Label'ы вновь закрываются "своими" CommandButton'ами
з. ы. знаю, что код вроде надо написать через цикл, но не получается.. . помогите написать код
Label1.Caption = Int(Rnd * 9) + 1
Label2.Caption = Int(Rnd * 9) + 1
Label3.Caption = Int(Rnd * 9) + 1
Label4.Caption = Int(Rnd * 9) + 1
Label5.Caption = Int(Rnd * 9) + 1
Label6.Caption = Int(Rnd * 9) + 1
Label7.Caption = Int(Rnd * 9) + 1
Label8.Caption = Int(Rnd * 9) + 1
Label9.Caption = Int(Rnd * 9) + 1
Label10.Caption = Int(Rnd * 9) + 1
Label11.Caption = Int(Rnd * 9) + 1
Label12.Caption = Int(Rnd * 9) + 1
Label13.Caption = Int(Rnd * 9) + 1
Label14.Caption = Int(Rnd * 9) + 1
Label15.Caption = Int(Rnd * 9) + 1
Label16.Caption = Int(Rnd * 9) + 1
Label17.Caption = Int(Rnd * 9) + 1
Label18.Caption = Int(Rnd * 9) + 1
Label19.Caption = Int(Rnd * 9) + 1
Label20.Caption = Int(Rnd * 9) + 1
Label21.Caption = Int(Rnd * 9) + 1
Label22.Caption = Int(Rnd * 9) + 1
Label23.Caption = Int(Rnd * 9) + 1
Label24.Caption = Int(Rnd * 9) + 1
Label25.Caption = Int(Rnd * 9) + 1
Label26.Caption = Int(Rnd * 9) + 1
Label27.Caption = Int(Rnd * 9) + 1
Label28.Caption = Int(Rnd * 9) + 1
Label29.Caption = Int(Rnd * 9) + 1
Label30.Caption = Int(Rnd * 9) + 1
Label31.Caption = Int(Rnd * 9) + 1
Label32.Caption = Int(Rnd * 9) + 1
Label33.Caption = Int(Rnd * 9) + 1
Label34.Caption = Int(Rnd * 9) + 1
CommandButton1.Visible = True
CommandButton2.Visible = True
CommandButton3.Visible = True
CommandButton4.Visible = True
CommandButton5.Visible = True
CommandButton6.Visible = True
CommandButton7.Visible = True
CommandButton8.Visible = True
CommandButton9.Visible = True
CommandButton10.Visible = True
CommandButton11.Visible = True
CommandButton12.Visible = True
CommandButton13.Visible = True
CommandButton14.Visible = True
CommandButton15.Visible = True
CommandButton16.Visible = True
CommandButton17.Visible = True
CommandButton18.Visible = True
CommandButton19.Visible = True
CommandButton20.Visible = True
CommandButton21.Visible = True
CommandButton22.Visible = True
CommandButton23.Visible = True
CommandButton24.Visible = True
CommandButton25.Visible = True
CommandButton26.Visible = True
CommandButton27.Visible = True
CommandButton28.Visible = True
CommandButton29.Visible = True
CommandButton30.Visible = True
CommandButton31.Visible = True
CommandButton32.Visible = True
CommandButton33.Visible = True
CommandButton34.Visible = True
CommandButton35.Visible = True
CommandButton36.Visible = True