#1   Report Post  
please help me
 
Posts: n/a
Default Automatic saving

I would like to include a button on a worksheet that when clicked will save
the worksheet as "purchase order" plus a number that is entered in a cell on
the worksheet.

How would I go about this?
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

1. Copy the code below:

Dim sPath As String
sPath = "C:\Documents and Settings\jmorin\Desktop\"
ActiveWorkbook.SaveAs Filename:=sPath & _
"Purchase Order " & Range("A1").Value & ".xls"

2. Go to View Toolbars and select "Control Toolbox"
3. Click on "Command Button" and draw a button on your
worksheet.
4. Right-click and go to "View Code".
5. Paste in the code from step 1.
6. Press ALT+Q to go back to Excel.
7. Press the "Exit Design Mode" the Control Toolbox
toolbar.

The code is set up to look for a PO# in A1. Change the
path to suit your needs.

HTH
Jason
Atlanta, GA

-----Original Message-----
I would like to include a button on a worksheet that

when clicked will save
the worksheet as "purchase order" plus a number that is

entered in a cell on
the worksheet.

How would I go about this?
.

  #3   Report Post  
 
Posts: n/a
Default

hi,
Put this in the button's code module
Sub commandbutton1_click()
Dim n As Range
Set n = Range("A1")
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"H:\CodeStuff\PO" & n & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:= _
"", ReadOnlyRecommended:=False _
, CreateBackup:=False
Workbooks.Open Filename:="H:\CodeStuff\POtest.xls"
ActiveWindow.ActivateNext
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub

-----Original Message-----
I would like to include a button on a worksheet that when

clicked will save
the worksheet as "purchase order" plus a number that is

entered in a cell on
the worksheet.

How would I go about this?
.

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
Turn off automatic date formatting? Nick Turner Excel Discussion (Misc queries) 3 July 13th 06 08:13 AM
How do I switch off automatic formatting (e.g. dates)? Coen Excel Discussion (Misc queries) 8 July 13th 06 08:08 AM
Automatic backup copy craigq Charts and Charting in Excel 2 April 11th 05 04:57 PM
Opening and saving Excel 2003 file from Excel 97. Rodrigo Excel Discussion (Misc queries) 2 December 12th 04 02:17 PM
Error Message appearing when saving a file JaneC Excel Discussion (Misc queries) 0 November 25th 04 10:35 PM


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