Copy the Workbook from userform i.e, load the workbook path and copy the output workbook path

mahaboobk

New Member
Joined
Oct 12, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello All

Hopefully one of you awesome excel experts can help...

I have to create a userform with Commandbutton to navigate on (Get workbook path) selecting the "Abc" excel workbook, it should copy with all the sheets that are available in "Abc" workbook and paste that in different path as "Abc" workbook name (Put workbook path)
1. Source of "Abc" should be selcted from commandbutton
2. destination of "Abc" should be given code path
3. click submit button

-------------------------------------------------------------------
I the below code has issue but have included it below. Its got messup

Sub Get_copy_sheets_Click()

Dim fileToOpen As Variant
Dim wb As Workbook

Application.ScreenUpdating = False

FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
If fileToOpen <> False Then
Set wb = Application.Workbooks.Open(fileToOpen)
'wb.Sheets(1).Range("A1:E20").Copy
'ThisWorkbook.Worksheets("SelectFile").Range("A10").PasteSpecial xlPasteValues
wb.Close False

Set wb = Application.Workbooks.GetOpenFilename
wb.Activate
ActiveWorkbook.Sheets("Any worksheet name or index").Copy
ActiveWorkbook.SaveAs "Path to the file"
ActiveWindow.Close
wb.Close

msgBox ("successfully copyed")
End Sub
 

Attachments

  • submit.JPG
    submit.JPG
    20.1 KB · Views: 10

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
please check the screen shot "Get and submit"
 

Attachments

  • Get and submit.JPG
    Get and submit.JPG
    34.4 KB · Views: 9
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top