
Private Sub cmdButton1_Click()
Cells(3, 1).Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim alto, sinx As Long
alto = ActiveCell.Top
sinx = ActiveCell.Left
cmdButton1.Top = alto 'alla stessa altezza di cella attiva
'cmdButton1.Left = sinx 'alla stessa colonna di cella attiva
End Sub |
Private Sub CommandButton1_Click()
Dim i As Integer
i = 2
Range(Cells(2, 1), Cells(2, 6)).Interior.Color = RGB(189, 215, 238)
While (Cells(i + 1, 1) <> "")
If Cells(i + 1, 1) <> Cells(i, 1) Then
If Cells(i, 1).Interior.Color = RGB(255, 255, 255) Then
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Interior.Color = RGB(189, 215, 238)
Else
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Interior.Color = RGB(255, 255, 255)
End If
Else
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Interior.Color = Cells(i, 1).Interior.Color
End If
Cells(i + 1, 7) = " "
i = i + 1
Wend
End Sub |
Private Sub CommandButton1_Click()
Dim i As Integer
i = 2
Range(Cells(2, 1), Cells(2, 6)).Interior.Color = RGB(189, 215, 238)
While (Cells(i + 1, 1) <> "")
If Cells(i + 1, 1) <> Cells(i, 1) Then
If Cells(i, 1).Interior.Color = RGB(255, 255, 255) Then
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Interior.Color = RGB(189, 215, 238)
Else
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Interior.Color = RGB(255, 255, 255)
End If
Else
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Interior.Color = Cells(i, 1).Interior.Color
End If
Cells(i + 1, 7) = " "
i = i + 1
Wend
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim alto, sinx As Long
alto = ActiveCell.Top
sinx = ActiveCell.Left
cmdButton1.Top = alto 'alla stessa altezza di cella attiva
'cmdButton1.Left = sinx 'alla stessa colonna di cella attiva
End Sub |
