+ Reply to Thread
Results 1 to 3 of 3

Save To Csv Running A Macro

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Exclamation 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

  2. #2
    Dave Peterson
    Guest

    Re: 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. #3
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    thanks

    thanks macro worked great

    thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1