Está en la página 1de 1

Mdulo1 - 1 Dim numeros(8) As Integer Dim i As Integer Dim posicion As Integer Dim mayor As Integer Dim indice As Integer

Sub vectors() cont = 1 For i = 1 To 8 Step 1 posicion = (8 - 1) * Rnd + 1 numeros(i) = cont Hoja1.Cells(1, i) = numeros(i) cont = cont + 1 Next i mayor = 0 For i = 1 To 8 Step 1 If (mayor < posicion) Then mayor = numeros(i) indice = i End If Next i Hoja1.Cells(3, 1) = mayor Hoja1.Cells(4, 1) = indice Hoja1.Cells(1, indice).Select With Selection.Interior .Color = RGB(243, 0, 0) End With End Sub

También podría gustarte