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: 2

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

mahaboobk

New Member
Joined
Oct 12, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. Web
please check the screen shot "Get and submit"
 

Attachments

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

Watch MrExcel Video

Forum statistics

Threads
1,118,765
Messages
5,574,111
Members
412,571
Latest member
Ventura7
Top