#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Save button

I have a Packing list on Sheet1,inventory Sheet2 and Customer info
Sheet3.
Sheet1 linked and formulated to pull data from sheet2 and sheet3. I
added save botton to save each packing list to another
folder(C:\Paking_List06) I would like to know how to write a VBA code
to export Sheet 1 to packing list folder.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Save button

Give this a try:

Sub ExportSheet()
' Macro 6/30/2006 by Jamie Hildebrand
'
''''''''''''''''''''''''''''''
'PLACE DESIRED DESTINATION HERE
FilePath$ = "C:\Parking_List06\"

'''''''''''''''''''''''''''''''
'THIS FORMATS THE FILE WITH THE
'CURRENT DATE FOLLOWED WITH THE
'TEXT "_Parking_Export.xls"
FileName$ = Format(Date, "MMDDYY") & "_Parking_Export.xls"

If Dir(FilePath$ & FileName$) < "" Then
response = MsgBox("That file already exists. Do you want to
overwrite it?", vbYesNo)
If response < vbYes Then
response = Trim(InputBox("Edit this name to prevent overwriting
old file.", "Change Name", FileName$))
If response = "" Then MsgBox "You didn't enter anything.": Exit
Sub
FileName$ = response
Else
Kill FilePath$ & FileName$

End If
End If
Sheets("Sheet1").Copy
ActiveWorkbook.SaveAs FileName:=FilePath$ & FileName$
ActiveWorkbook.Close
MsgBox "Export Finished", vbInformation, "Status"

End Sub

Regards,
Jamie


wrote:
I have a Packing list on Sheet1,inventory Sheet2 and Customer info
Sheet3.
Sheet1 linked and formulated to pull data from sheet2 and sheet3. I
added save botton to save each packing list to another
folder(C:\Paking_List06) I would like to know how to write a VBA code
to export Sheet 1 to packing list folder.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Save button

Thank you I am working on it.

jseven wrote:
Give this a try:

Sub ExportSheet()
' Macro 6/30/2006 by Jamie Hildebrand
'
''''''''''''''''''''''''''''''
'PLACE DESIRED DESTINATION HERE
FilePath$ = "C:\Parking_List06\"

'''''''''''''''''''''''''''''''
'THIS FORMATS THE FILE WITH THE
'CURRENT DATE FOLLOWED WITH THE
'TEXT "_Parking_Export.xls"
FileName$ = Format(Date, "MMDDYY") & "_Parking_Export.xls"

If Dir(FilePath$ & FileName$) < "" Then
response = MsgBox("That file already exists. Do you want to
overwrite it?", vbYesNo)
If response < vbYes Then
response = Trim(InputBox("Edit this name to prevent overwriting
old file.", "Change Name", FileName$))
If response = "" Then MsgBox "You didn't enter anything.": Exit
Sub
FileName$ = response
Else
Kill FilePath$ & FileName$

End If
End If
Sheets("Sheet1").Copy
ActiveWorkbook.SaveAs FileName:=FilePath$ & FileName$
ActiveWorkbook.Close
MsgBox "Export Finished", vbInformation, "Status"

End Sub

Regards,
Jamie


wrote:
I have a Packing list on Sheet1,inventory Sheet2 and Customer info
Sheet3.
Sheet1 linked and formulated to pull data from sheet2 and sheet3. I
added save botton to save each packing list to another
folder(C:\Paking_List06) I would like to know how to write a VBA code
to export Sheet 1 to packing list folder.

Thanks


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
The SAVE AS button does not show save to G: drive Marilyn S New Users to Excel 5 January 17th 08 02:00 AM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
save button in excel to save one of the worksheets with a cell value as its name Colin[_9_] Excel Programming 2 September 21st 04 11:28 PM


All times are GMT +1. The time now is 02:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"