PDA

View Full Version : Export worksheet problem with path



jmaocubo
02-15-2013, 11:36 AM
Hello everyone

I need your help ....

I've looked on the forums for a solution but can not find any that do the work, or adapt one to my case.

I have a userform with several fields, then I created a button that transfers that data into a form in sheets

("Checklist").
I can't find out how to do the rest of the code:

1) to open windows explorer to saveas path (path from cell A2 sheets ("ADIMN"),
2) then let me choose the rest of the path and save only the Checklist sheet in a new workbook.
3) The name of the new workbook will be the constant in sheets ("Checklist"). Range ("A8"). Value and the rest of the name

will be added manually
4) In the original file: fields clearcontents


Can anyone help me?

Thanks in advance

Miguel

patel
02-16-2013, 06:59 AM
to select a folder you can use
Sub SelectFolder() ' dialog
Set objFSO = CreateObject("Scripting.FileSystemObject")
InitialFoldr$ = "E:\" '<<< Startup folder
With Application.FileDialog(msoFileDialogFolderPicker) 'User input for folder to look at
.InitialFileName = Application.DefaultFilePath & "\"
.Title = "Please select a folder to list Files from"
.InitialFileName = InitialFoldr$
.Show
If .SelectedItems.Count = 0 Then Exit Sub
mfolder = .SelectedItems(1) & "\"
End With
MsgBox mfolder & " selected"
End Sub