Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default export to csv macro

Try this PM4

Sub ActiveSheet_To_CSV_File()
Dim wb As Workbook
Dim strdate As String
Dim Fname As String
strdate = Format(Date, "mmyyyy")
Fname = ActiveSheet.Name _
& " " & strdate & ".csv"
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs Fname, FileFormat:=xlCSV
.Close False
End With
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"PM4" wrote in message ...

Hi,

I'm looking for a macro in excel that lets me export to csv.
The filename must be the name of the sheet combined with the month and
year on the moment of export (like finance-052006.csv).
Can somebody help me out? I've been searching for a few hours but no
luck so far. I found macro's with static filenames or with a prompt. I
even tried to eddit the macro's but only got some errors.
It looks like i'll be working woth macro's much more the next few
months so i'm going to spend more time understanding it.

Kind regards,
PM.


--
PM4
------------------------------------------------------------------------
PM4's Profile: http://www.excelforum.com/member.php...o&userid=34025
View this thread: http://www.excelforum.com/showthread...hreadid=537853



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
Macro to export when printing sriddle Excel Discussion (Misc queries) 3 December 13th 08 12:32 AM
help with macro to export data Mayte Excel Worksheet Functions 2 April 27th 08 05:07 AM
excel xml export macro Dan Excel Discussion (Misc queries) 0 March 19th 08 03:16 PM
export as vba macro sali[_2_] Excel Programming 5 January 9th 06 01:40 PM
Record macro to export xml IoM Excel Programming 7 May 9th 05 09:49 PM


All times are GMT +1. The time now is 05:23 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"