Iterar todo o arquivo Excel
Eu quero iterar sobre um arquivo excel inteiro.
Sub Rechteck1_KlickenSieAuf()
Dim Zieldatei As String
Dim Line As Integer
'activate and protetct file
ThisWorkbook.Worksheets(1).Activate
ActiveWorkbook.Protect
'Create desired file
Zieldatei = Application.GetSaveAsFilename(FileFilter:="AVL (*.rtf), *.rtf", InitialFileName:="AVL.rtf")
'Open desired file
Open Zieldatei For Output As #1
With ThisWorkbook.Worksheets(1)
For Line = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
'Write Read-In Data into target data
Print #1, Join(Application.Transpose(Application.Transpose(.Range(.Cells(Line, 1), .Cells(Line, .Columns.Count).End(xlToLeft)).Value)), "|")
Next
End With
Close #1
Exit Sub
Este código lança a mensagem: "tipos incompatíveis". Não sei porque. Eu agradeceria toda ajuda.