Hi,
I am trying to export data from an xlsm to a new xls.
But the problem is that it only copies the first row and I need a table to be copied.
My macro is this one:
Sub ExportarTXT()
Worksheets("Import").Activate
If Sheets("Import").Activate Then
Range("A1").Select
If ActiveCell = Empty Then GoTo salte
Open "c:\ZLibra.xls" For Output As 1
regresa:
Codigo = ActiveCell
Print #1 , Codigo
ActiveCell.Offset(1, 0).Select
If ActiveCell = Empty Then GoTo salte
GoTo regresa:
salte:
Close #1
End If
Worksheets("Import").Activate
End Sub
Thanks,
I am trying to export data from an xlsm to a new xls.
But the problem is that it only copies the first row and I need a table to be copied.
My macro is this one:
Sub ExportarTXT()
Worksheets("Import").Activate
If Sheets("Import").Activate Then
Range("A1").Select
If ActiveCell = Empty Then GoTo salte
Open "c:\ZLibra.xls" For Output As 1
regresa:
Codigo = ActiveCell
Print #1 , Codigo
ActiveCell.Offset(1, 0).Select
If ActiveCell = Empty Then GoTo salte
GoTo regresa:
salte:
Close #1
End If
Worksheets("Import").Activate
End Sub
Thanks,