I'm having a problem, I need to extract a data listing from excel that I've filtered with over 200 thousand lines, I have the option to do the excel parse every line and delete it but I wanted to do this without losing the Given already present then I researched and found a way to only copy what is visible (which left active in the filter) but with this when I save the macro that only weighed 10mb ta weighing 16mb and excel is choking, this is not interesting because I need to send it by email, if I manually copy the filter and paste it resolves but I need agility. Would anyone know what's wrong with this code?
Sub extrair()
''''''''' limpa a planilha que vai receber a lista ''''''
Sheets("Base").Select
Cells.Select
Range("A1").Activate
Selection.ClearContents
Range("A1").Select
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''' insere o filtro CE na coluna de estados '''''
Sheets("INF").Select
If Not ActiveSheet.AutoFilterMode Then
ActiveSheet.Range("A1").AutoFilter
End If
ActiveSheet.Range("$A$1:$CB$1048575").AutoFilter Field:=68, Criteria1:="CE"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''' seleção do filtro o que deve ser copiado ''''''''''''''''''''''
fimr = 1048576
contR = 1
contC = 1
Do While Cells(fimr, 68).Value <> "CE"
fimr = fimr - 1
Loop
contR = 1048576 - fimr
valor = Cells(1, contC).Value
Do While valor <> ""
contC = contC + 1
valor = Cells(1, contC).Value
Loop
Range(Cells(1, 1), Cells(contR, contC)).Select
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''' copia só o que está visível e cola na planilha Base''''''''''''
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Base").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''' retorna ao local do botão da macro ''''''''''
Application.CutCopyMode = False
Sheets("Macro").Select
End Sub