13 junio 2011

1º BATX, Correción errores

Hola chic@s:

En el ejercicio de recuperación de la 2ª evaluación, Maribel ha detectado una errata en el código fuente de la macro de la función 4. Debe quedar así (faltaba un End If al final):

Sub Funcion4()
   Dim n1, n2, n3, miHoja
   miHoja= ThisComponent.Sheets(0)
   n1=miHoja.getCellByPosition(1,1).getValue()
   n2=miHoja.getCellByPosition(1,2).getValue()
   n3=miHoja.getCellByPosition(1,3).getValue()
   If ((n1=n2) And (n2=n3)) Then
      MsgBox "Son iguales"
   Else
      If (n1>n2) Then
          If (n1>n3) Then
             MsgBox "El primer número es mayor"
          Else
             MsgBox "El tercer número es mayor"
         End If
      Else
          If (n2>n3) Then
             MsgBox "El segundo número es mayor"
          Else
             MsgBox "El tercer número es mayor"
         End If
      End If
   End If
End Sub

Un saludo,

0 comentarios:

Publicar un comentario