Errores
Hola! Quisiera que me informes porque me indica error al querer compilar. El error me lo indica en esta parte de la función! ""planilla (3,3) As Integer""
'Option Explicit
Public columna As Integer
Public Sub Form_Load()
Dim planilla(3, 3) As Integer
planilla(0, 0) = 0
planilla(0, 1) = 3
planilla(0, 2) = 8
planilla(0, 3) = 20
planilla(1, 0) = 5
planilla(1, 1) = 2
planilla(1, 2) = 4
planilla(1, 3) = 9
planilla(2, 0) = 6
planilla(2, 1) = 7
planilla(2, 2) = 12
planilla(2, 3) = 18
planilla(3, 0) = 15
planilla(3, 1) = 16
planilla(3, 2) = 17
planilla(3, 3) = 30
End Sub
Function calculo(lontxt1 As Integer, cautxt2 As Integer, planilla (3,3) As Integer
) As Integer
Dim i As Integer
Dim fila As Integer
Dim j As Integer
For i = 0 To 3 Step 1
If lontxt1 = planilla(i, 0) Then
fila = i
'Else
' If lontxt1 < planilla(i, 0) Then
'fila = i
End If
Next i
' For j = 0 To 3 Step 1
' If cautxt2 = planilla(fila, j) Then
' columna = j
'Else
' If cautxt2 < planilla(fila, j) Then
' columna = j
' End If
' Next j
' calculo = planilla(0, columna)
calculo = fila
End Function
Private Sub cmb1_Click()
Dim diametro As Integer
Dim caudal As Integer
Dim puto(3, 3) As Integer
diatxt3 = calculo(diametro, caudal, puto(3, 3))
End Sub
Muchas gracias!
'Option Explicit
Public columna As Integer
Public Sub Form_Load()
Dim planilla(3, 3) As Integer
planilla(0, 0) = 0
planilla(0, 1) = 3
planilla(0, 2) = 8
planilla(0, 3) = 20
planilla(1, 0) = 5
planilla(1, 1) = 2
planilla(1, 2) = 4
planilla(1, 3) = 9
planilla(2, 0) = 6
planilla(2, 1) = 7
planilla(2, 2) = 12
planilla(2, 3) = 18
planilla(3, 0) = 15
planilla(3, 1) = 16
planilla(3, 2) = 17
planilla(3, 3) = 30
End Sub
Function calculo(lontxt1 As Integer, cautxt2 As Integer, planilla (3,3) As Integer
) As Integer
Dim i As Integer
Dim fila As Integer
Dim j As Integer
For i = 0 To 3 Step 1
If lontxt1 = planilla(i, 0) Then
fila = i
'Else
' If lontxt1 < planilla(i, 0) Then
'fila = i
End If
Next i
' For j = 0 To 3 Step 1
' If cautxt2 = planilla(fila, j) Then
' columna = j
'Else
' If cautxt2 < planilla(fila, j) Then
' columna = j
' End If
' Next j
' calculo = planilla(0, columna)
calculo = fila
End Function
Private Sub cmb1_Click()
Dim diametro As Integer
Dim caudal As Integer
Dim puto(3, 3) As Integer
diatxt3 = calculo(diametro, caudal, puto(3, 3))
End Sub
Muchas gracias!
1 respuesta
Respuesta de intman
1