Professional Documents
Culture Documents
12345
12345
Programacion
f1 = Range(rango1).Row
c1 = Range(rango1).Column
f2 = Range(rango2).Row
c2 = Range(rango2).Column
f3 = Range(rango3).Row
c3 = Range(rango3).Column
fs = Range(rango1).Rows.Count
cs = Range(rango1).Columns.Count
For i = 0 To fs - 1
For j = 0 To cs - 1
Next
Next
End Function
End Sub
Function RestarMatrices(rango1 As String, rango2 As String, rango3 As String)
f1 = Range(rango1).Row
c1 = Range(rango1).Column
f2 = Range(rango2).Row
c2 = Range(rango2).Column
f3 = Range(rango3).Row
c3 = Range(rango3).Column
fs = Range(rango1).Rows.Count
cs = Range(rango1).Columns.Count
For i = 0 To fs - 1
For j = 0 To cs - 1
Next
Next
End Function
End Sub
f = Range(Ruta.Text).Row
c = Range(Ruta.Text).Column
fs = Range(Ruta.Text).Rows.Count
cs = Range(Ruta.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
a(i, j) = Cells(f + i - 1, c + j - 1)
Next j
Next i
matriz = a
End Function
fs = UBound(matriz1, 1)
cs = UBound(matriz1, 2)
Dim result() As Variant
For i = 1 To fs
For j = 1 To cs
Next j
Next i
sumarM = result
End Function
fs = UBound(matriz1, 1)
cs = UBound(matriz1, 2)
For i = 1 To fs
For j = 1 To cs
Next j
Next i
restarM = result
End Function
Dim s As Variant
fsA = UBound(matriz1, 1)
csA = UBound(matriz1, 2)
fsB = UBound(matriz2, 1)
csB = UBound(matriz2, 2)
For i = 1 To fsA
For j = 1 To csB
s=0
For k = 1 To csA
s = s + matriz1(i, k) * matriz2(k, j)
Next k
salida(i, j) = s
Next j
Next i
productoM = salida
End Function
fs = UBound(matriz, 1)
cs = UBound(matriz, 2)
f = Range(s.Text).Row
c = Range(s.Text).Column
For i = 1 To fs
For j = 1 To cs
Next i
End Sub
f = Range(s.Text).Row
c = Range(s.Text).Column
fs = Range(s.Text).Rows.Count
cs = Range(s.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Cells(i + f - 1, j + c - 1) = ""
Next j
Next i
End Sub
f = Range(s.Text).Row
c = Range(s.Text).Column
fs = Range(s.Text).Rows.Count
cs = Range(s.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Cells(i + f - 1, j + c - 1) = Rnd
Next j
Next i
End Sub
Private Sub B_1_Click()
End Sub
End Sub
Borrar M_3
End Sub
Aleatorio M_3
End Sub
Userform
Codigo #3
Sub M_1_Enter()
foco = 1
End Sub
Sub M_2_Enter()
foco = 2
End Sub
f = Range(s.Text).Row
c = Range(s.Text).Column
fs = Range(s.Text).Rows.Count
cs = Range(s.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Cells(i + f - 1, j + c - 1) = ""
Next j
Next i
End Sub
Sub aleatorio(s As Object)
f = Range(s.Text).Row
c = Range(s.Text).Column
fs = Range(s.Text).Rows.Count
cs = Range(s.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Cells(i + f - 1, j + c - 1) = Rnd
Next j
Next i
End Sub
End Sub
End Sub
CODIGO #4
Sub M_1_Enter()
foco = 1
End Sub
Sub M_2_Enter()
foco = 2
End Sub
Sub M_3_Enter()
foco = 3
End Sub
f = Range(s.Text).Row
c = Range(s.Text).Column
fs = Range(s.Text).Rows.Count
cs = Range(s.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Cells(i + f - 1, j + c - 1) = ""
Next j
Next i
End Sub
c = Range(s.Text).Column
fs = Range(s.Text).Rows.Count
cs = Range(s.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Cells(i + f - 1, j + c - 1) = Rnd
Next j
Next i
End Sub
End Sub
End Sub
Código #5
Dim f As Integer
Dim c As Integer
Dim fs As Integer
Dim cs As Integer
Dim i As Integer
Dim j As Integer
f = Range(A.Text).Row
c = Range(A.Text).Column
fs = Range(A.Text).Rows.Count
cs = Range(A.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Next j
Next i
matriz = SALIDA
End Function
Dim fs As Integer
Dim cs As Integer
fs = UBound(matriz, 1)
cs = UBound(matriz, 2)
Dim i As Integer
Dim j As Integer
Dim f As Integer
Dim c As Integer
f = Range(A.Text).Row
c = Range(A.Text).Column
For i = 1 To fs
For j = 1 To cs
Next j
Next i
End Sub
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim m As Integer
Dim n As Integer
m = UBound(A, 1)
n = UBound(A, 2)
ReDim B(1 To m, 1 To n + 1)
For i = 1 To m
For j = 1 To n
B(i, j) = A(i, j)
Next j
Next i
ReDim resultados(1 To m, 1 To 1)
For i = 1 To m
div = B(i, i)
If div = 0 Then
foundrow = False
For j = i + 1 To m
ReDim tem(1 To n + 1)
For k = 1 To n + 1
temp(k) = B(i, k)
B(i, k) = B(j, k)
B(j, k) = temp(k)
Next k
foundrow = True
Exit For
End If
Next j
div = B(i, i)
End If
For k = 1 To n
Next k
For j = 1 To m
If j <> i Then
mul = B(j, i)
For k = 1 To n
Next k
End If
Next j
Next i
For i = 1 To m
resultados(i, 1) = A(1, n)
Next i
ReDim matrizresultante(1 To m, 1 To n + 1)
For i = 1 To m
For j = 1 To n
matrizresultante(i, j) = B(i, j)
Next j
matrizresultante(i, n + 1) = resultados(i, 1)
Next i
ELGauss = matrizresultante
End Function
Codigo #6
Dim f As Integer
Dim c As Integer
Dim fs As Integer
Dim cs As Integer
Dim i As Integer
Dim j As Integer
f = Range(A.Text).Row
c = Range(A.Text).Column
fs = Range(A.Text).Rows.Count
cs = Range(A.Text).Columns.Count
For i = 1 To fs
For j = 1 To cs
Next j
Next i
matriz = SALIDA
End Function
Dim fs As Integer
Dim cs As Integer
fs = UBound(matriz, 1)
cs = UBound(matriz, 2)
Dim i As Integer
Dim j As Integer
Dim f As Integer
Dim c As Integer
f = Range(A.Text).Row
c = Range(A.Text).Column
For i = 1 To fs
For j = 1 To cs
Next j
Next i
End Sub
Dim fs As Integer
Dim cs As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim m As Integer
Dim n As Integer
m = UBound(A, 1)
n = UBound(A, 2)
ReDim B(1 To m, 1 To n)
B=A
For i = 1 To m
If B(i, i) = 0 Then
For j = i + 1 To n
'Intercambiar filas
For k = 1 To n
temp = B(i, k)
B(i, k) = B(j, k)
B(j, k) = temp
Next k
Exit For
End If
Next j
End If
div = B(i, i)
For k = 1 To n
B(i, k) = B(i, k) / div
Next k
End If
For j = 1 To m
If j <> i Then
mul = B(j, i)
For k = 1 To n
Next k
End If
End If
Next j
Next i
ELGauss = B
End Function
End Sub