Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MI CODIGO DEJO DE FUNCIONAR, ME IMPRIME EL PDF PERO SIN DATOS

publicado

Hola buenas tardes, para solicitar de su valioso apoyo, encontré un ejemplo en el que se hace una búsqueda de información y el resultado se muestra en un listbox, posterior acople el código a mi macro y la fui delimitando para que funcionara como yo lo necesito, sin embargo después del ultimo cambio y que funcionaba al 100% el código y me sacaba el reporte impreso en PDF de los resultados encontrados, ahora solo crea una hoja en PDF con los encabezados de las columnas pero sin información dentro de estas, no sé porque lo hace, comparto el código:

Private Sub ExportaPDF_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next

'Elimina hoja y crea hoja dando el mismo nombre que la eliminada
Sheets("TEMPORAL").Delete
ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = "TEMPORAL"
Set a = Sheets("TEMPORAL")

For x = 1 To UserForm2.LISTREP.ListCount - 5
a.Cells(x + 2, "A") = LISTREP.List(x, 0)
a.Cells(x + 2, "B") = LISTREP.List(x, 1)
a.Cells(x + 2, "C") = LISTREP.List(x, 2)
a.Cells(x + 2, "F") = LISTREP.List(x, 3)
a.Cells(x + 2, "G") = CDate(LISTREP.List(x, 4))
a.Cells(x + 2, "I") = LISTREP.List(x, 5)
Next

a.Activate
a.Range("A1") = "REPORTE REFERENCIAS SPEI"
With a.Range("A1:I1")
.Merge
.VerticalAlignment = xlCenter
.HorizontalAlignment = xlCenter
.RowHeight = 20
.Font.Size = 11
End With

a.Range("A2") = "ID"
a.Range("B2") = "CLIENTE"
a.Range("C2") = "SUCURSAL"
a.Range("F2") = "NO. FACTURA"
a.Range("G2") = "FECHA"
a.Range("I2") = "REFERENCIA"
uf = a.Range("I" & Rows.Count).End(xlUp).Row
a.Range("G2:G" & uf).NumberFormat = "dd/mm/yyyy"
a.Range("B2:B").ColumnWidth = 31
a.Range("A:I").Columns.AutoFit
a.Range("A:A").ColumnWidth = 7

Application.PrintCommunication = True
With ActiveSheet.PageSetup
.PrintArea = "$A$1:$I$" & uf + 4
.FitToPagesWide = 1
.FitToPagesTall = 1
.Orientation = xlLandscape
End With
Application.PrintCommunication = True
ActiveSheet.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
a.Delete
Sheets("Hoja1").Select
MsgBox "El reporte se imprimió con éxito", vbCritical, "AVISO"
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

Featured Replies

No hay posts para mostrar

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.