Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi everyone, I tried to save my xls-sheets to txt-files with a following macro: Sub SaveFiles() Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets ' copy the sheet to its own workbook sh.Copy ActiveWorkbook.SaveAs "C:\Temp\" & sh.Name & ".txt", _ FileFormat:=xlTextWindows ActiveWorkbook.Close SaveChanges:=False Next End Sub Everything is fine except one thing. There comes some extra tabs to th end of some lines in my txt-files. What is the best way to avoid thos empty spaces? Is it possible to make some kind of loop to my macro? Or is there a existing "command" (member) in some class? I really appreciate any of your tips! -Beginner81 -- Beginner8 ----------------------------------------------------------------------- Beginner81's Profile: http://www.excelforum.com/member.php...fo&userid=2538 View this thread: http://www.excelforum.com/showthread.php?threadid=38862 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Macro to Open File, Delete Contents, Save New File | Excel Discussion (Misc queries) | |||
Macro Save File (Unique file name) | Excel Worksheet Functions | |||
ASP: Open Excel File with Macro, Allow Macro to run, and then save | Excel Programming | |||
Macro to insert values from a file and save another sheet as a .txt file | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |