Segue sua rotina "Exportar" alterada, veja se vai de encontro ao que espera
Private Sub CommandButton2_Click()
Dim Cliente(2) As String
Cliente(0) = "Confortt"
Cliente(1) = "Maciel"
Cliente(2) = "Solar"
Sheets("xml estofado").Select
nreg = Sheets("xml estofado").Cells(Cells.Rows.Count, "D").End(xlUp).Row
lin = 2
For x = 0 To 2
For lin = 2 To nreg
If UCase(Sheets("xml estofado").Cells(lin, 4)) Like UCase("*" & Cliente(x) & "*") Then
If Sheets("xml estofado").Cells(lin, 33) = "copiado" Then
Else
Sheets("xml estofado").Cells(lin, 2).Copy Destination:=Sheets("planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(1, 0)
Sheets("xml estofado").Cells(lin, 29).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 3)
Sheets("xml estofado").Cells(lin, 4).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 4)
Sheets("xml estofado").Cells(lin, 14).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 5)
Sheets("xml estofado").Cells(lin, 18).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 6)
Sheets("xml estofado").Cells(lin, 19).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 7)
Sheets("xml estofado").Cells(lin, 30).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 8)
Sheets("xml estofado").Cells(lin, 31).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 9)
Sheets("xml estofado").Cells(lin, 1).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 10)
Sheets("xml estofado").Cells(lin, 34).Value = Date
Sheets("xml estofado").Cells(lin, 34).Copy Destination:=Sheets("Planilha " & Cliente(x)).Range("A1048576").End(xlUp).Offset(0, 1)
Sheets("xml estofado").Cells(lin, 33) = "copiado"
End If
End If
lin = lin + 1
Next
Next
ListView1.ListItems.Clear
For x = 0 To 2
Sheets("Planilha " & Cliente(x)).Select
Columns("A:O").Select
Selection.Style = "Normal 3"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("B:B").Select
Selection.NumberFormat = "m/d/yyyy"
Columns("C:C").Select
Selection.NumberFormat = "m/d/yyyy"
Columns("D:D").Select
Selection.NumberFormat = "0.00"
Columns("I:I").Select
Selection.NumberFormat = "0.00"
Selection.NumberFormat = "0.0"
Selection.NumberFormat = "0"
Columns("J:J").Select
Selection.NumberFormat = "0.00"
Selection.NumberFormat = "0.0"
Selection.NumberFormat = "0"
Range("A1:O1").Select
Selection.Font.Bold = True
Selection.Font.Size = 11
Selection.Font.Size = 12
Selection.Font.Size = 11
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.399975585192419
.PatternTintAndShade = 0
End With
Dim Intervalo As Range
Set Intervalo = Range("A2:O" & [A2:O5000].SpecialCells(xlCellTypeLastCell).Row)
Intervalo.Select
borda_ok_mesmo
'Sheets("planilha Solar").Select
Range("A1").Select
Range("A1048576").End(xlUp).Offset(1, 0).Select
Next
ActiveWorkbook.Save
Unload Me
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 25/06/2016 7:50 am