saltar celda
Publicado por vibet (25 intervenciones) el 20/09/2005 02:58:20
Pretendo mostrar en pantalla las lineas de un grid.. para ello utilizo For nInd = 8 To Me.GrdInfoClientes.Rows - 1
y voy mostrando los datos sumando cada vez a cada celda de la columna b el valor que quiera. uso una plantilla excel, alguien sabe alguna manera para que cuando llegue a un determinado numero de celda "salte" a otra columna y siga mostrando los datos restantes, os dejo parte del código para clarificar .... pretendo esto
Private Sub Todas_Click()
Dim ContaLin As Integer
Dim xExcel As Excel.Application
Dim wBook As Workbook
titulo = "CAPRICHOS36"
If Val(Me.GrdInfoClientes.TextMatrix(Me.GrdInfoClientes.Row, 0)) <= 0 Then
MsgBox "No Hay Datos Para Listar ", vbCritical, titulo
Else
Set xExcel = New Excel.Application
xExcel.Workbooks.Add App.Path & "\ETIQUETAS.xlt"
Me.MousePointer = vbHourglass
ContaLin = 6
total = 0
For nInd = 1 To Me.GrdInfoClientes.Rows - 1
'pvp
xExcel.Range(Chr(Asc("B")) & ContaLin).Select
xExcel.ActiveCell.FormulaR1C1 = GrdInfoClientes.TextMatrix(nInd, 2) & UCase("€")
ContaLin = ContaLin + 8
If ContaLin = 62 Then
Excel.Range("C6").Select
columnac''''''''' aquí pretendo el salto a otra columna para seguir mostrando datos
End If
Next nInd
Me.MousePointer = vbHourglass
ContaLin = 4
total = 0
For nInd = 1 To Me.GrdInfoClientes.Rows - 1
'codigo
xExcel.Range(Chr(Asc("B")) & ContaLin).Select
xExcel.ActiveCell.FormulaR1C1 = "Codigo nº: " & Val(GrdInfoClientes.TextMatrix(nInd, 0))
gracias de antemano al alma caritativa que me ayude!!!!
y voy mostrando los datos sumando cada vez a cada celda de la columna b el valor que quiera. uso una plantilla excel, alguien sabe alguna manera para que cuando llegue a un determinado numero de celda "salte" a otra columna y siga mostrando los datos restantes, os dejo parte del código para clarificar .... pretendo esto
Private Sub Todas_Click()
Dim ContaLin As Integer
Dim xExcel As Excel.Application
Dim wBook As Workbook
titulo = "CAPRICHOS36"
If Val(Me.GrdInfoClientes.TextMatrix(Me.GrdInfoClientes.Row, 0)) <= 0 Then
MsgBox "No Hay Datos Para Listar ", vbCritical, titulo
Else
Set xExcel = New Excel.Application
xExcel.Workbooks.Add App.Path & "\ETIQUETAS.xlt"
Me.MousePointer = vbHourglass
ContaLin = 6
total = 0
For nInd = 1 To Me.GrdInfoClientes.Rows - 1
'pvp
xExcel.Range(Chr(Asc("B")) & ContaLin).Select
xExcel.ActiveCell.FormulaR1C1 = GrdInfoClientes.TextMatrix(nInd, 2) & UCase("€")
ContaLin = ContaLin + 8
If ContaLin = 62 Then
Excel.Range("C6").Select
columnac''''''''' aquí pretendo el salto a otra columna para seguir mostrando datos
End If
Next nInd
Me.MousePointer = vbHourglass
ContaLin = 4
total = 0
For nInd = 1 To Me.GrdInfoClientes.Rows - 1
'codigo
xExcel.Range(Chr(Asc("B")) & ContaLin).Select
xExcel.ActiveCell.FormulaR1C1 = "Codigo nº: " & Val(GrdInfoClientes.TextMatrix(nInd, 0))
gracias de antemano al alma caritativa que me ayude!!!!
Valora esta pregunta


0