Samuel Cano
Board Regular
- Joined
- Jun 24, 2002
- Messages
- 62
no doy con la sintaxis... ayuda por favor.
Gracias.
Gracias.
Sub Uno()
Dim x(2) As String
x(0) = "uno"
x(1) = "dos"
x(2) = "tres"
Call Dos(x())
End Sub
'--------------------------
Sub Dos(Arg() As String)
MsgBox Arg(0)
MsgBox Arg(1)
MsgBox Arg(2)
End Sub
'--------------------------
Sub Tres()
Dim x As Variant
x = Array("uno", "dos", "tres")
Call Cuatro(x)
End Sub
'--------------------------
Sub Cuatro(Arg As Variant)
For x = 0 To UBound(Arg)
MsgBox Arg(x)
Next x
End Sub
Sub Uno()
Dim x(2) As String
x(0) = "uno"
x(1) = "dos"
x(2) = "tres"
Call Dos(x())
MsgBox x(2), vbInformation, "De Uno"
End Sub
'--------------------------
Sub Dos(Arg() As String)
MsgBox Arg(0)
MsgBox Arg(1)
MsgBox Arg(2)
Arg(2) = "three"
End Sub
'--------------------------
Sub Tres()
Dim x As Variant
x = Array("uno", "dos", "tres")
Call Cuatro(x)
MsgBox x(2), vbInformation, "De Tres"
End Sub
'--------------------------
Sub Cuatro(ByVal Arg As Variant)
For x = 0 To UBound(Arg)
MsgBox Arg(x)
Next x
Arg(2) = "three"
End Sub
'_______________________
'¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sub Cinco()
Dim x(2) As String
x(0) = "uno"
x(1) = "dos"
x(2) = "tres"
Seis "Azul", "Nicaragua", x
Seis "Rojo", "Peru", "Agua", "Fuego", "Viento", 99
End Sub
'_______________________
'¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sub Seis(ByVal strColor As String, _
ByVal strPais As String, _
ParamArray LoQueSea() As Variant)
MsgBox "La bandera de " & strPais & " tiene " & strColor
End Sub
Private Sub cboContrato_Change()
lngLargoDelArrayPU = Sheets(contrato).[B65536].End(xlUp).Row - 10 '' Largo Del Array PU
''! determina cuantos CONTROLES mostrar, según
''! variable que determina la CANTIDAD DE CONCEPTOS EN CONTRATO (lngLargoDelArrayPU)
''! y asigna valores de cada array a etiquetas (minimo 1 máximo 20)
Select Case lngLargoDelArrayPU
Case Is = 1
uno
.
.
.
Case Is = 4
cuatro
.
.
.
Case Is = 20
veinte
End Select
End Sub
'----------------------------------------------------------
'----------------------------------------------------------
Private Sub cuatro()
''! array CONCEPTO
lngIndicePU = 0
Dim strConcepto() As String
ReDim Preserve strConcepto(lngLargoDelArrayPU)
For lngFila = 11 To lngUltimaFilaOcupadaPU
strConcepto(lngIndicePU) = ActiveSheet.Cells(lngFila, 4).Text
lngIndicePU = lngIndicePU + 1
Next
''! array CATEGORIA
lngIndicePU = 0
Dim strCategoria() As String
ReDim Preserve strCategoria(lngLargoDelArrayPU)
For lngFila = 11 To lngUltimaFilaOcupadaPU
strCategoria(lngIndicePU) = ActiveSheet.Cells(lngFila, 3).Text
lngIndicePU = lngIndicePU + 1
Next
''! array PRECIO UNITARIO
lngIndicePU = 0
Dim dblPrecioUnitario() As Double
ReDim Preserve dblPrecioUnitario(lngLargoDelArrayPU)
For lngFila = 11 To lngUltimaFilaOcupadaPU
dblPrecioUnitario(lngIndicePU) = ActiveSheet.Cells(lngFila, 6).Value
lngIndicePU = lngIndicePU + 1
Next
lblConcepto0.Caption = strConcepto(0)
lblConcepto1.Caption = strConcepto(1)
lblConcepto2.Caption = strConcepto(2)
lblConcepto3.Caption = strConcepto(3)
lblConcepto4.Caption = ""
lblConcepto5.Caption = ""
lblConcepto6.Caption = ""
lblConcepto7.Caption = ""
lblConcepto8.Caption = ""
lblConcepto9.Caption = ""
lblConcepto10.Caption = ""
lblConcepto11.Caption = ""
lblConcepto12.Caption = ""
lblConcepto13.Caption = ""
lblConcepto14.Caption = ""
lblConcepto15.Caption = ""
lblConcepto16.Caption = ""
lblConcepto17.Caption = ""
lblConcepto18.Caption = ""
lblConcepto19.Caption = ""
lblCAT0.Caption = strCategoria(0)
lblIMP0.Tag = strCategoria(0)
lblCAT1.Caption = strCategoria(1)
lblIMP1.Tag = strCategoria(1)
lblCAT2.Caption = strCategoria(2)
lblIMP2.Tag = strCategoria(2)
lblCAT3.Caption = strCategoria(3)
lblIMP3.Tag = strCategoria(3)
lblCAT4.Caption = ""
lblCAT5.Caption = ""
lblCAT6.Caption = ""
lblCAT7.Caption = ""
lblCAT8.Caption = ""
lblCAT9.Caption = ""
lblCAT10.Caption = ""
lblCAT11.Caption = ""
lblCAT12.Caption = ""
lblCAT13.Caption = ""
lblCAT14.Caption = ""
lblCAT15.Caption = ""
lblCAT16.Caption = ""
lblCAT17.Caption = ""
lblCAT18.Caption = ""
lblCAT19.Caption = ""
lblPU0.Caption = Format(dblPrecioUnitario(0), "#,##0.00")
lblPU1.Caption = Format(dblPrecioUnitario(1), "#,##0.00")
lblPU2.Caption = Format(dblPrecioUnitario(2), "#,##0.00")
lblPU3.Caption = Format(dblPrecioUnitario(3), "#,##0.00")
lblPU4.Caption = ""
lblPU5.Caption = ""
lblPU6.Caption = ""
lblPU7.Caption = ""
lblPU8.Caption = ""
lblPU9.Caption = ""
lblPU10.Caption = ""
lblPU11.Caption = ""
lblPU12.Caption = ""
lblPU13.Caption = ""
lblPU14.Caption = ""
lblPU15.Caption = ""
lblPU16.Caption = ""
lblPU17.Caption = ""
lblPU18.Caption = ""
lblPU19.Caption = ""
txtCANT0.Visible = True
txtCANT1.Visible = True
txtCANT2.Visible = True
txtCANT3.Visible = True
txtCANT4.Visible = False
txtCANT5.Visible = False
txtCANT6.Visible = False
txtCANT7.Visible = False
txtCANT8.Visible = False
txtCANT9.Visible = False
txtCANT10.Visible = False
txtCANT11.Visible = False
txtCANT12.Visible = False
txtCANT13.Visible = False
txtCANT14.Visible = False
txtCANT15.Visible = False
txtCANT16.Visible = False
txtCANT17.Visible = False
txtCANT18.Visible = False
txtCANT19.Visible = False
End Sub