Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,468
    Thanks
    132
    Thanked 7 Times in 7 Posts

    Exporting certain data from a sheet and as save as CSV File

    I have the month and year and D6 on sheet1

    I would like a macro the will extract a range of data for eg B12 to D200 on sheet1 and save this as csv file using the name of the workbook.month (extract from D6).csv

    Your assistance in this regard is most appreciated

    http://www.mrexcel.com/forum/excel-q...-csv-file.html
    Attached Files Attached Files

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,043
    Thanks
    144
    Thanked 539 Times in 514 Posts
    Hi Howard

    see attached file.
    The subroutine assumes
    1.date is always in cell [D6]
    2. you don't want the Contra amounts in row 11 in the CSV file
    3. you want all the rest, but no descriptions from column [A]


    zeddy
    Attached Files Attached Files

  3. The Following User Says Thank You to zeddy For This Useful Post:

    HowardC (2013-03-24)

  4. #3
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,468
    Thanks
    132
    Thanked 7 Times in 7 Posts
    Hi Zeddy

    Hi Zeddy

    Thanks for the help, much appreciated

    1) I need the file name to be ExportTb.csv.Feb (if date is feb)
    2) I need to be given the option to change the name in the code if the need arises

    Regards

    Howard

  5. #4
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,043
    Thanks
    144
    Thanked 539 Times in 514 Posts
    Hi Howard

    see attached file

    Is this what you want?

    zeddy
    Attached Files Attached Files

  6. #5
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,468
    Thanks
    132
    Thanked 7 Times in 7 Posts
    Hi Zeddy

    Many thanks for the help-this is 100%

    Regards

    Howard

  7. #6
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,724
    Thanks
    124
    Thanked 678 Times in 616 Posts
    Howard,

    Keep in mind that any changes you may have made to the worksheet prior to running Zeddy's code will be saved to the .CSV file but not to the original .xls file. If this is important to you, and it is wise to maintain an updated original, than additional code should save the file first before saving it as the .CSV file. Just a thought.

  8. #7
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,468
    Thanks
    132
    Thanked 7 Times in 7 Posts
    Thanks Maudibe for the tip. I will add this to the code

Posting Permissions

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