+ Reply to Thread
Results 1 to 4 of 4

need assist with save as csv code

Hybrid View

Guest need assist with save as csv... 01-19-2005, 02:06 AM
Leith Ross Hello Husky101, Unless... 01-19-2005, 03:27 AM
Guest Re: need assist with save as... 01-19-2005, 06:06 AM
Guest Re: need assist with save as... 01-20-2005, 02:06 AM
  1. #1
    husky101@yahoo.com
    Guest

    need assist with save as csv code

    I have this following code
    What I require is at the activeCell.SpecialCells(xlLastCell)
    for it to add the next blank row to the selection.
    I am having some difficulty with this.
    any assistance will be greatly appreciated.
    Paul

    Sub SaveAsCSV()
    'This macro will SAVE AS to C:\Trees folder, which must exist before
    macro runs

    '
    Range("A2").Select
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
    Application.CutCopyMode = False

    ActiveWorkbook.SaveAs Filename:="C:\Trees\" & "UP" & Format(Now,
    "yymmddhhmm") & ".csv", FileFormat:=xlCSV, _
    CreateBackup:=False
    ActiveWorkbook.Close SaveChanges:=False


    End Sub


  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Husky101,

    Unless the system you are port the csv files varies from Excel's csv format, why not have Excel do the file conversion by choosing .csv when save the file. You could save yourself a lot of time and trouble.

    Hope this helps,
    Leith Ross

  3. #3
    Bob Phillips
    Guest

    Re: need assist with save as csv code

    Husky,

    Please try this

    Sub SaveAsCSV()
    'This macro will SAVE AS to C:\Trees folder, which must exist before
    macro runs

    '
    Range("A2").Select
    Range(Selection, ActiveCell.SpecialCells(xlLastCell).Offset(1,0)).Copy
    Workbooks.Add
    ActiveSheet.Paste
    Application.CutCopyMode = False

    ActiveWorkbook.SaveAs Filename:="C:\Trees\" & "UP" & Format(Now,
    "yymmddhhmm") & ".csv", FileFormat:=xlCSV, _
    CreateBackup:=False
    ActiveWorkbook.Close SaveChanges:=False


    End Sub


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <husky101@yahoo.com> wrote in message
    news:1106114416.244659.10000@c13g2000cwb.googlegroups.com...
    > I have this following code
    > What I require is at the activeCell.SpecialCells(xlLastCell)
    > for it to add the next blank row to the selection.
    > I am having some difficulty with this.
    > any assistance will be greatly appreciated.
    > Paul
    >
    > Sub SaveAsCSV()
    > 'This macro will SAVE AS to C:\Trees folder, which must exist before
    > macro runs
    >
    > '
    > Range("A2").Select
    > Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
    > Selection.Copy
    > Workbooks.Add
    > ActiveSheet.Paste
    > Application.CutCopyMode = False
    >
    > ActiveWorkbook.SaveAs Filename:="C:\Trees\" & "UP" & Format(Now,
    > "yymmddhhmm") & ".csv", FileFormat:=xlCSV, _
    > CreateBackup:=False
    > ActiveWorkbook.Close SaveChanges:=False
    >
    >
    > End Sub
    >




  4. #4
    husky101@yahoo.com
    Guest

    Re: need assist with save as csv code

    Thanks very much Bob,
    Works a charm.

    Cheers paul


+ 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