Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to save worksheet

I need help writing a macro that I can place in a .xlt file.

The .xlt file is modified and saved as a .xls file.The macro will allow me to automatically save a worksheet from the workbook as a tab delimited text file with the same name as the .xls file without prompting for a file name

Current macro that I am using is:

ChDir "C:\Documents and Settings\My Documents\
ActiveWorkbook.SaveAs Filename:=
"C:\Documents and Settings\My Documents\" & InputBox("File Name ?"),
FileFormat:=xlText, CreateBackup:=Fals

Thank

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to save worksheet

If this lcase(thisworkbook.name,4) = ".xls" then
ChDir "C:\Documents and Settings\My Documents\"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\My Documents\" & _
application.Substitute(thisworkbook.name,".xls",". txt"), _
FileFormat:=xlText, CreateBackup:=False

End if

--
Regards,
Tom Ogilvy


"RSVP" wrote in message
...
I need help writing a macro that I can place in a .xlt file.

The .xlt file is modified and saved as a .xls file.The macro will allow me

to automatically save a worksheet from the workbook as a tab delimited text
file with the same name as the .xls file without prompting for a file name.

Current macro that I am using is:

ChDir "C:\Documents and Settings\My Documents\"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\My Documents\" & InputBox("File Name

?"), _
FileFormat:=xlText, CreateBackup:=False

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to save worksheet

Tom

Problem solved, thanks for the assist.
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
How write Macro to save worksheet to a RELATIVE address Barry Excel Discussion (Misc queries) 10 May 1st 08 08:24 PM
Save Macro and Custom Toolbar in Worksheet Pat Excel Discussion (Misc queries) 1 April 24th 08 04:12 AM
macro save a file name from a cell in 1st worksheet karene Excel Discussion (Misc queries) 2 April 10th 06 12:13 PM
Worksheet Buttons (Save, Save As, Cut, Paste, etc.) Not Working SuzieQ12345 Excel Worksheet Functions 5 January 21st 05 02:57 PM
using macro to save worksheet with unique file name Noell Excel Programming 3 October 15th 03 10:24 PM


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

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

About Us

"It's about Microsoft Excel"