Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Save To Csv Running A Macro


how do i save this macro to a csv file

Sheets("sheet1").Select
Range("E4").Select
Name = ActiveCell.Value
If ActiveCell = "" Then
GoTo 2

Else
ChDir "C:\Documents and Settings\skirk\My Documents\macros"
ActiveWorkbook.SaveAs Filename:=Name

thanks
steve


--
stevekirk
------------------------------------------------------------------------
stevekirk's Profile: http://www.excelforum.com/member.php...o&userid=37328
View this thread: http://www.excelforum.com/showthread...hreadid=570639

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Save To Csv Running A Macro

Maybe...

dim myFileName as string
with worksheets("Sheet1")
.select
myfilename = "C:\Documents and Settings\skirk\My Documents\macros\" & _
.range("E4").value
.parent.saveas filename:=myfilename, fileformat:=xlcsv
end with

But this saves the workbook as a .csv file--it doesn't save the macro in that
..csv file. CSV files are plain text--they don't save formatting, formulas,
macros, etc.


stevekirk wrote:

how do i save this macro to a csv file

Sheets("sheet1").Select
Range("E4").Select
Name = ActiveCell.Value
If ActiveCell = "" Then
GoTo 2

Else
ChDir "C:\Documents and Settings\skirk\My Documents\macros"
ActiveWorkbook.SaveAs Filename:=Name

thanks
steve

--
stevekirk
------------------------------------------------------------------------
stevekirk's Profile: http://www.excelforum.com/member.php...o&userid=37328
View this thread: http://www.excelforum.com/showthread...hreadid=570639


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Save To Csv Running A Macro


thanks macro worked great

thank you


--
stevekirk
------------------------------------------------------------------------
stevekirk's Profile: http://www.excelforum.com/member.php...o&userid=37328
View this thread: http://www.excelforum.com/showthread...hreadid=570639

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
running a macro from a list rufusf Excel Worksheet Functions 0 February 22nd 06 04:38 PM
Save a Macro ducttape Excel Discussion (Misc queries) 3 February 20th 06 04:46 PM
How do I save macro so it's there for all Excel sheets? Save a macro in Excel Excel Discussion (Misc queries) 2 September 22nd 05 08:11 PM
How to stop getting the file save box when running a macro Pank Mehta Excel Discussion (Misc queries) 1 March 29th 05 04:05 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM


All times are GMT +1. The time now is 08:17 PM.

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"