Algo asi.
En un Modulo pegas el code.
Public Sub Exportar(ListBuscar As ListView)
Dim objExcel As Excel.Application
Dim Ancho As Integer
Dim Dato As Variant
Dim c As Integer
Dim f As Integer
Dim ColumnaExcel As Integer
Set objExcel = New Excel.Application
With objExcel
.Visible = False
.SheetsInNewWorkbook = 1 'Determina el numero de hojas que se mostrara en el Excel
.Workbooks.Add 'Crea el Libro
.Sheets("Hoja1").Name = "Registro de Hardware"
'Recorrer las celdas del Listview
'----------------------------------------------
' Bucle principal
'---------------------------------------------
For f = 0 To ListBuscar.ListItems.Count
ColumnaExcel = 1
For c = 1 To ListBuscar.ColumnHeaders.Count
If f = 0 Then
.Cells(1, ColumnaExcel) = ListBuscar.ColumnHeaders(c)
Else
If c = 1 Then
.Cells(f + 1, 1) = ListBuscar.ListItems(f).Text
Else
Dato = ListBuscar.ListItems(f).SubItems(c - 1)
' Prevención para que las fechas pasen a Excel como tales
' En mi listview los títulos de las columnas fecha empiezan con F.
If Left(ListBuscar.ColumnHeaders(c).Text, 2) = "F." And Dato <> "" Then Dato = CDate(Dato)
.Cells(f + 1, ColumnaExcel) = Dato
End If
.Cells(f + 1, ColumnaExcel + 1).Select
'ColumnaExcel = ColumnaExcel + 1
End If
ColumnaExcel = ColumnaExcel + 1
Next
Next
'----------------------------------------------
' Fin del Bucle principal
'----------------------------------------------
.Range("A1").Select
.Range(.Selection, .Selection.End(xlToRight)).Select
PonerSombraCelda objExcel, 15, xlSolid
PonerBordeCelda objExcel
.Range(.Selection, .Selection.End(xlDown)).Select
PonerBordeCelda objExcel
.Cells.Select
.Selection.WrapText = False
.Cells.EntireColumn.AutoFit
.Range("A1").Select
End With
'Preparar impresión en apasiado y a una hoja de ancho
With objExcel.ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
objExcel.Visible = True
Set objExcel = Nothing
Screen.MousePointer = vbDefault
End Sub
Public Sub PonerBordeCelda(Objeto As Excel.Application)
With Objeto
.Selection.Borders(xlEdgeLeft).Weight = xlThick
.Selection.Borders(xlEdgeTop).Weight = xlThick
.Selection.Borders(xlEdgeBottom).Weight = xlThick
.Selection.Borders(xlEdgeRight).Weight = xlThick
.Selection.Borders(xlInsideVertical).Weight = xlThin
.Selection.Borders(xlInsideHorizontal).Weight = xlThin
End With
End Sub
Public Sub PonerSombraCelda(Objeto As Excel.Application, ColorIndex As _
Integer, Pattern As Integer)
With Objeto.Selection.Interior
.ColorIndex = ColorIndex
.Pattern = Pattern
End With
End Sub
y lo llamas asi
Call Exportar(ListView1)
Salu2.