Anda di halaman 1dari 1

Curso de Visual Excel Soluciones a las prcticas propuestas Prctica n6 Sub muestra_colorindex1() Dim i As Integer, n As Integer n=0 Worksheets.

Add before:=Sheets(1) [A1].Value = "Color" [B1].Value = "Index Number" ActiveSheet.Name = "ColorIndex" For i = 2 To 58 Range("A" & i).Interior.ColorIndex = n Range("B" & i).Value = n n=n+1 Next i ActiveSheet.[B:B].EntireColumn.AutoFit End Sub Tambin puede ser as: Sub muestra_colorindex2() Dim fila, n As Byte Cells(1, 1) = "Color" Cells(1, 2) = "Index Number" For fila = 2 To 58 Range("A" & fila).Interior.ColorIndex = n Range("B" & fila).Value = n n=n+1 Next fila End Sub

Enrique Manuel Cabello Portero

Anda mungkin juga menyukai