+ Reply to Thread
Results 1 to 2 of 2

Need to Create a Popup Macro that will allow user to select destination file

  1. #1
    Registered User
    Join Date
    04-02-2019
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    74

    Need to Create a Popup Macro that will allow user to select destination file

    The code below works well by opening a destination file template and pasting certain rows from the source file to the destination file. The problem is I will eventually need to share these files and allow others to use them. You will see that the portion that executes the opening of the destination file is very specific (highlighted in red). I would like to create a popup chooser in place of that portion so that a new user can choose the template based on where they have saved it on their machine. I've never done this so any help is greatly appreciated.

    Please Login or Register  to view this content.
    Sub CopyDataAndSave()
    Application.ScreenUpdating = False
    Dim desWB As Workbook, desWS As Worksheet, srcWS1 As Worksheet, srcWS2 As Worksheet
    Set srcWS1 = ThisWorkbook.Sheets("Detailed Outputs")
    Set srcWS2 = ThisWorkbook.Sheets("User Inputs")
    Set desWB = Workbooks.Open(Environ("userprofile") & "\Desktop\Upwork\Model_Template.xlsx")
    Set desWS = Sheets("Input")
    With srcWS1
    .Range("B8:M8").Copy
    desWS.Range("Q4").PasteSpecial xlPasteValues
    .Range("B45:M45 ").Copy
    desWS.Range("Q8").PasteSpecial xlPasteValues
    Application.CutCopyMode = False
    End With
    ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & Application.PathSeparator & srcWS2.Range("C14").Value & ".xlsx", FileFormat:=51
    Application.ScreenUpdating = True
    End Sub
    Please Login or Register  to view this content.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,451

    Re: Need to Create a Popup Macro that will allow user to select destination file

    Hi YukkonSoDank,

    There is a built-in dialog that might do what you want. Try "Application.FindFile" and it will open a file selection dialog. If you set the desWB to the file the user finds and clicks on, it might do exactly what you need.

    Read some more at: http://www.44342.com/ms-excel-f84-t51875-p1.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using a macro to create directories and refer to data input by a user, and select a file
    By TnD_Guy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2018, 04:36 PM
  2. [SOLVED] How to select a file instead of selecting the file's destination path/folder
    By dedark05 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2016, 10:17 PM
  3. Print Preview Tab and popup window so the user can select printer
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2015, 12:56 PM
  4. [SOLVED] Macro to prompt user to select a file and the selected file should saved in location
    By logesh excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2015, 03:43 PM
  5. [SOLVED] Macro that prompts user to select a file to open and perform another macro on this file
    By grimmy26 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-16-2014, 08:39 AM
  6. User Select Destination Cell
    By zcbeb10 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2011, 10:06 AM
  7. create a pause in print macro to allow user to select printer
    By Scott53 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2005, 03:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1