PC Review


Reply
Thread Tools Rate Thread

command button to save

 
 
=?Utf-8?B?c2hvb3R6?=
Guest
Posts: n/a
 
      22nd Jun 2007
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:="Microsoft 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 With Quote
 
 
 
 
tissot.emmanuel
Guest
Posts: n/a
 
      22nd Jun 2007
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:="Microsoft 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" <(E-Mail Removed)> a écrit dans le message de news:
B6EB999C-2D0D-480A-BB44-(E-Mail Removed)...
>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:="Microsoft 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() =?Utf-8?B?UGF1bCBEZW5uaXM=?= Microsoft Excel Misc 5 18th Sep 2006 05:34 PM
disable save and saveas from menubar and save via command button =?Utf-8?B?U3RldmUgRQ==?= Microsoft Excel Programming 5 13th Sep 2006 11:51 PM
Disable save, save as, but allow save via command button =?Utf-8?B?VGltTg==?= Microsoft Excel Programming 10 1st Sep 2006 07:05 PM
Save Command Button Help! EnGo Microsoft Excel Programming 1 27th Jul 2006 09:49 PM
Directing auto save to VB's command SAVE button function =?Utf-8?B?Sm9obiBIIFc=?= Microsoft Access Form Coding 0 22nd Jun 2005 06:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 PM.