how to save Txt in Desktop using excel 2010?
Thanks
Code:
Sub Save_Desktop() Application.ScreenUpdating = False
Dim Pasta As String
Application.DisplayAlerts = False
template_file = ActiveWorkbook.FullName
fileSaveName = "C:\Documents and Settings\master\Desktop\Txt" + VBA.Strings.Format(Now, "dd-mm-yyyy") + ".txt"
Dim newBook As Workbook
Dim plan As Worksheet
Dim Intervalo As Range
Set Intervalo = [C5:H22]
Set newBook = Workbooks.Add
ThisWorkbook.Activate
Intervalo.Copy
newBook.Sheets(1).[A1].PasteSpecial xlPasteValues
For i = newBook.Sheets.Count To 2 Step -1
newBook.Sheets(i).Delete
Next
newBook.SaveAs Filename:=fileSaveName, FileFormat:=xlTextWindows, CreateBackup:=False
newBook.Close SaveChanges:=True
Set newBook = Nothing
Application.ScreenUpdating = True
End Sub
Thanks