SERGE_BLIZNUK
Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору в Excel Alt-F11 - вставить код (объект Worksheet событие Change) Код: Private Sub Worksheet_Change(ByVal Target As Range) privCellValue = Cells(1, 1) ' Берём значение ячейки в переменную privCellValue Select Case privCellValue Case 1 With Cells(5, 5).Interior .ColorIndex = 39 .Pattern = xlSolid End With Case 2 With Cells(5, 5).Interior .ColorIndex = 45 .Pattern = xlSolid End With Case 3 With Cells(5, 5).Interior .ColorIndex = 50 .Pattern = xlSolid End With Case 4 To 9999999 With Cells(5, 5).Interior .ColorIndex = 3 .Pattern = xlSolid End With Case Else ' Other values. Cells(5, 5).Interior.ColorIndex = xlNone End Select End Sub | |