Não encontrei em seu modelo a Coluna Data da Maquina, somente Colunas "Data Compra e Data Final", então, baseando na Coluna G, Data Compra, utilizze a rotina abaixo, se não for a coluna correta, é só ajustar a mesma na Rotina :
Sub CARREGALISTVIEW()
Dim lastRow As Long
Dim rows As Long
Dim li As ListItem
Dim X As Long
Dim sDate As Date
Dim sDataG 'Data na Coluna G
'''index
Dim j As Integer
Dim k As Integer
'''''''''''
Dim i As Integer
'''''''''
' Adiciona as colunas
With ListView1
.Gridlines = True
.View = lvwReport
.ColumnHeaders.Clear
'.FullRowSelect
Me.ListView1.ColumnHeaders.Add , , "Seq"
Me.ListView1.ColumnHeaders.Add , , "I.D"
Me.ListView1.ColumnHeaders.Add , , "C.N.P.J"
Me.ListView1.ColumnHeaders.Add , , "Descrição - Ativo Imobilizado"
Me.ListView1.ColumnHeaders.Add , , "Vr Compra"
Me.ListView1.ColumnHeaders.Add , , "Vida Útil"
Me.ListView1.ColumnHeaders.Add , , "Data Compra"
Me.ListView1.ColumnHeaders.Add , , "Data Final"
Me.ListView1.ColumnHeaders.Add , , "Data Atual"
Me.ListView1.ColumnHeaders.Add , , "M %"
Me.ListView1.ColumnHeaders.Add , , "Vr. Mensal"
Me.ListView1.ColumnHeaders.Add , , "T %"
Me.ListView1.ColumnHeaders.Add , , "Vr.Trimestre"
Me.ListView1.ColumnHeaders.Add , , "S %"
Me.ListView1.ColumnHeaders.Add , , "Vr.Semestre"
Me.ListView1.ColumnHeaders.Add , , "A %"
Me.ListView1.ColumnHeaders.Add , , "Vr.Anual"
'Me.ListView1.ColumnHeaders.Add , , "Vr.Residual"
Me.ListView1.ColumnHeaders.Add , , "Situação"
Me.ListView1.ColumnHeaders.Add , , "Familia"
Me.ListView1.ColumnHeaders(1).Width = 40
Me.ListView1.ColumnHeaders(2).Width = 40
Me.ListView1.ColumnHeaders(3).Width = 80
Me.ListView1.ColumnHeaders(4).Width = 180
Me.ListView1.ColumnHeaders(5).Width = 70
Me.ListView1.ColumnHeaders(6).Width = 50
Me.ListView1.ColumnHeaders(7).Width = 60
Me.ListView1.ColumnHeaders(8).Width = 60
Me.ListView1.ColumnHeaders(9).Width = 60
Me.ListView1.ColumnHeaders(10).Width = 40
Me.ListView1.ColumnHeaders(11).Width = 60
Me.ListView1.ColumnHeaders(12).Width = 40
Me.ListView1.ColumnHeaders(13).Width = 60
Me.ListView1.ColumnHeaders(14).Width = 40
Me.ListView1.ColumnHeaders(15).Width = 60
Me.ListView1.ColumnHeaders(16).Width = 40
Me.ListView1.ColumnHeaders(17).Width = 60
'Me.ListView1.ColumnHeaders(18).Width = 80
Me.ListView1.ColumnHeaders(18).Width = 90
Me.ListView1.ColumnHeaders(19).Width = 180
End With
'...................................................................
'limpar
ListView1.ListItems.Clear
lastRow = Plan1.Cells(Plan1.Cells.rows.Count, "a").End(xlUp).Row
' Adiciona itens
For X = 2 To lastRow
sDataG = Plan1.Cells(X, "g").Value 'Datas na Coluna G
sDate = Date 'Data do Sistema
If sDataG = sDate Then 'Se Data na Coluna G for Igual a Data do sistema
Set li = ListView1.ListItems.Add(Text:=Plan1.Cells(X, "a").Value)
li.ListSubItems.Add Text:=Plan1.Cells(X, "b").Value
li.ListSubItems.Add Text:=Plan1.Cells(X, "c").Value
li.ListSubItems.Add Text:=Plan1.Cells(X, "d").Value
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "e").Value, "#,##0.00")
li.ListSubItems.Add Text:=Plan1.Cells(X, "f").Value
li.ListSubItems.Add Text:=Format(CDate(Plan1.Cells(X, "g").Value))
li.ListSubItems.Add Text:=Format(CDate(Plan1.Cells(X, "h").Value))
li.ListSubItems.Add Text:=Format(CDate(Plan1.Cells(X, "i").Value))
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "j").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "k").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "l").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "M").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "N").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "O").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "P").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "Q").Value, "#,##0.00")
li.ListSubItems.Add Text:=Format(Plan1.Cells(X, "R").Value, "#,##0.00")
li.ListSubItems.Add Text:=Plan1.Cells(X, "S").Value
li.ListSubItems.Add Text:=Plan1.Cells(X, "T").Value
li.ListSubItems.Add Text:=k
k = k + 1
End If
Next
ListView1.ListItems.Add , , "Hello"
Call SendMessage(ListView1.hwnd, LVM_SETTEXTBKCOLOR, 0&, vbRed)
End Sub
Quanto a colorir a coluna, depois dou uma olhada.
[]s
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 18/06/2012 8:40 pm