Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
lqfong
 
Posts: n/a
Default Saving worksheets using a Macro


Hi,

I have multiple worksheets, and I need to save them in text tab
delimited format.

How can I do this using macros? For example I have 5 worksheets, the
macro would save the worksheets as sheet1.txt, sheet2.txt, sheet3.txt
etc...

Thanks!


--
lqfong
------------------------------------------------------------------------
lqfong's Profile: http://www.excelforum.com/member.php...o&userid=35774
View this thread: http://www.excelforum.com/showthread...hreadid=555908

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Saving worksheets using a Macro

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim newWks As Worksheet

For Each wks In ActiveWorkbook.Worksheets

wks.Copy 'to a new workbook
Set newWks = ActiveSheet

With newWks
Application.DisplayAlerts = False
.Parent.SaveAs Filename:="C:\TEMP\" & .Name & ".txt", _
FileFormat:=xlText
Application.DisplayAlerts = True
.Parent.Close savechanges:=False
End With
Next wks
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

lqfong wrote:

Hi,

I have multiple worksheets, and I need to save them in text tab
delimited format.

How can I do this using macros? For example I have 5 worksheets, the
macro would save the worksheets as sheet1.txt, sheet2.txt, sheet3.txt
etc...

Thanks!

--
lqfong
------------------------------------------------------------------------
lqfong's Profile: http://www.excelforum.com/member.php...o&userid=35774
View this thread: http://www.excelforum.com/showthread...hreadid=555908


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving with Macro mabbutt Excel Discussion (Misc queries) 2 May 11th 06 03:39 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Applying same macro to all worksheets in workbook [email protected] Excel Discussion (Misc queries) 2 October 19th 05 11:25 PM
Macro to change worksheets in the same workbook James C Excel Discussion (Misc queries) 2 October 19th 05 08:04 PM
Saving without Macro mrbalaje Excel Discussion (Misc queries) 0 May 6th 05 11:41 AM


All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"