Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default command button to save

I am trying to open a save from button 3 for just the worksheet not the whole
workbook. I am really new at this I have two tries..help

Private Sub CommandButton3_Click()
fileSaveName = Application.GetSaveAsFilename(fileFilter:="Microso ft Excel
Workbook (*.xls), *.xls")
ActiveWorkbook.SaveAs Filename:=fileSaveName
End Sub
or
Dim vResponse As Variant

vResponse = Application.GetSaveAsFilename( _
FileFilter:="Microsoft Excel Files (*.xls), *.xls", _
Title:="Please select your file")
ActiveWorkbook.SaveAs Filename:=fileSaveName
If vResponse < False Then
MsgBox Prompt:="You selected '" & vResponse & "'.", _
Buttons:=vbOKOnly Or vbInformation
Else
MsgBox Prompt:="You cancelled.", _
Buttons:=vbOKOnly Or vbInformation
End If
End Sub




or


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default command button to save

Hi,

To save a worksheet you have to put in a new workbook like this:
ActiveSheet.Move
Or like this:
ActiveSheet.Copy
Then you save the new workbook.

Private Sub CommandButton3_Click()
Dim vResponse As Variant
vResponse = Application.GetSaveAsFilename(FileFilter:="Microso ft Excel
Files (*.xls), *.xls", _
Title:="Please select your file")
If vResponse < False Then
ActiveSheet.Move 'ActiveSheet.Copy 'depending what you needs
ActiveWorkbook.SaveAs Filename:=vResponse
Else
MsgBox "You cancelled.", vbOKOnly + vbInformation
End If
End Sub

Regards,

Manu/

"shootz" a écrit dans le message de news:
...
I am trying to open a save from button 3 for just the worksheet not the
whole
workbook. I am really new at this I have two tries..help

Private Sub CommandButton3_Click()
fileSaveName = Application.GetSaveAsFilename(fileFilter:="Microso ft Excel
Workbook (*.xls), *.xls")
ActiveWorkbook.SaveAs Filename:=fileSaveName
End Sub
or
Dim vResponse As Variant

vResponse = Application.GetSaveAsFilename( _
FileFilter:="Microsoft Excel Files (*.xls), *.xls", _
Title:="Please select your file")
ActiveWorkbook.SaveAs Filename:=fileSaveName
If vResponse < False Then
MsgBox Prompt:="You selected '" & vResponse & "'.", _
Buttons:=vbOKOnly Or vbInformation
Else
MsgBox Prompt:="You cancelled.", _
Buttons:=vbOKOnly Or vbInformation
End If
End Sub




or




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
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
disable save and saveas from menubar and save via command button Steve E Excel Programming 5 September 13th 06 11:51 PM
Disable save, save as, but allow save via command button TimN Excel Programming 10 September 1st 06 07:05 PM
Save as new file command button EnGo Excel Programming 2 July 28th 06 02:55 PM
Save Command Button Help! EnGo[_2_] Excel Programming 1 July 27th 06 09:49 PM


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