Private Sub CommandButton1_Click() Dim ultimaFila, fila, contador As Long Dim linea As String NomeArquivo = "c:\teste.txt" Selection.End(xlDown).Select ultimaFila = Selection.Row Selection.End(xlUp).Select Set oSistemaArquivo = CreateObject("Scripting.FileSystemObject") Set arquivo = oSistemaArquivo.OpenTextFile(NomeArquivo, 1, False, -2) fila = 1 contador = 1 Workbooks.Add xx = Workbooks.Count Workbooks(xx).Activate For Each w In Worksheets vnome_plan = UCase(w.Name) Exit For Next x = 1 If UCase(Mid(vnome_plan, 1, 4)) = "PLAN" Then vnome1 = "Plan" Else vnome1 = "Pasta" End If vnome_plan = vnome1 + CStr(x) Do While arquivo.AtEndOfStream <> True linea = arquivo.ReadLine Sheets(vnome_plan).Cells(fila, "a").Value = linea Application.StatusBar = "Lendo linha número = " & contador & " - carregando " + vnome_plan DoEvents fila = fila + 1 contador = contador + 1 If fila > ultimaFila Then x = x + 1 If x > 3 Then Worksheets.Add after:=ActiveSheet End If vnome_plan = vnome1 + CStr(x) fila = 1 End If Loop Application.StatusBar = "" DoEvents End Sub