Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to export when printing | Excel Discussion (Misc queries) | |||
help with macro to export data | Excel Worksheet Functions | |||
excel xml export macro | Excel Discussion (Misc queries) | |||
export as vba macro | Excel Programming | |||
Record macro to export xml | Excel Programming |