Bom dia Daniel,
Substitui todo o seu código por este:
Option Explicit
Sub GoResult()
Dim wb As Workbook
Dim wsResul As Worksheet
Dim wsRelat As Worksheet
Dim UltL As Long
Dim UltC As Long
Dim i As Long
Set wb = ThisWorkbook
Set wsResul = wb.Worksheets("Resultado")
Set wsRelat = wb.Worksheets("Relatório cru")
UltL = wsRelat.Cells(Rows.Count, 1).End(xlUp).Row
UltC = wsRelat.Cells(1, Columns.Count).End(xlToLeft).Column
wsResul.Visible = True
wsResul.Select
wsResul.Range(Cells(1, 1), Cells(UltL, UltC)).ClearContents
For i = 1 To UltC
If wsRelat.Cells(1, i).Value = "Numero svo" Then
wsRelat.Select
wsRelat.Range(Cells(1, 1), Cells(UltL, 1)).Copy
wsResul.Select: wsResul.Cells(1, 1).Select
wsResul.Paste
wsRelat.Select
wsRelat.Range(Cells(1, i), Cells(UltL, i)).Copy
wsResul.Select: wsResul.Cells(1, 2).Select
wsResul.Paste
Application.CutCopyMode = False
Exit For
End If
Next i
wsRelat.Visible = False
Set wb = Nothing
Set wsResul = Nothing
Set wsRelat = Nothing
End Sub
Sub BackReport()
Dim wb As Workbook
Dim wsResul As Worksheet
Dim wsRelat As Worksheet
Set wb = ThisWorkbook
Set wsResul = wb.Worksheets("Resultado")
Set wsRelat = wb.Worksheets("Relatório cru")
wsRelat.Visible = True
wsResul.Select
wsResul.Visible = False
Set wb = Nothing
Set wsResul = Nothing
Set wsRelat = Nothing
End Sub
Qualquer coisa da o grito.
Abraço
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 11/06/2014 8:05 am