1. J

    FileDialog to only show xlsx files containing certain text

    Hi, in my Macro I have added a FileDialog popup for users to select a file. However, sometimes the subfolders contain a lot of files. I would like to narrow down the number of files visible to reduce the likelihood of a user selecting the wrong file. Is it possible for me to add a line to the...
  2. J

    How stop a code if 'Cancel' is clicked in the file dialog box

    I'm using the below code to bring up the file dialog box so the user can select a file path to save a file. What I want to do is stop an error from occuring when the user clicks the 'Cancel' button in the dialog box. Currently when you click 'Cancel', it comes up with 'Run-time error '5'...
  3. F

    VBA - Import text to specific sheet, with delimited with file dialog prompt

    Hello I'm trying to import a text file into a specific sheet, where it should do a Text to columns with the delimiter set as a space. What I would like to do: Clear all data in Sheet "SVKData" File Prompt for a text file, that imports data into "SVKData" the data should just be imported into...
  4. S

    FileDialog has Compile Error: User-defined type not define even when object library is referenced

    I am trying to create a file dialog with Microsoft Access 16.0 Object Library checked. However, the Compile Error: User-defined type not define still exists. Please help. My code below if it helps: Public Function DirPicker(Optional ByVal strWindowTitle As String = "Select Location to Save") As...
  5. D

    Create a new workbook and worksheet by getting the data from the certain columns and rows

    Hi folks I need your help on excel file transformation. So, I want to create database table names which has been originally stored in excel file as provided below. Thus, I need VBA code to copy out the certain cells and paste them as a filename, sheet name, column name and as a row. The desired...
  6. L

    Opening files and editing them

    Hey guys, I ran into a small problem that I can't figure out. The code lets a user choose a location, once chosen it goes through all the files in the folder and makes a txt named the same as the file. Sub GetFileNames() Dim sFolder As String Dim MyFSO As FileSystemObject Dim...
  7. Jaafar Tribak

    FileDialog InitialView Property doesn't work !

    Hi dear forum members, Sub Test() Dim oDlg As FileDialog Set oDlg = Application.FileDialog(msoFileDialogOpen) With oDlg .Title = "Select a file" .InitialFileName = "C:\MyPictures" .AllowMultiSelect = False .InitialView =...
  8. S

    Use FileDialog to copy a file address

    Morning All I am trying different methods of getting links to files into a Listbox. One method is to paste the file address into a Textbox and then transfer that over to the Listbox as a hyperlink (posted on this forum). The next method I want to explore, which I think may be a little cleaner...
  9. A

    Loops of file, filter, save

    hello all! i'm trying to learn to code and have worked through some old broken code for years trying to help my department function. i'm now trying to rebuild the code and am in need of some assistance in building this code. i have a list of people, with a datasheet needed for each. i have the...
  10. A

    How to browse a file txt and import all the info to a excel workbook

    Hi good day! I need help please, I need a macro to be able to select a ".txt" file (using the windows browser) and import all the information on that txt to a new workbook. Then save that new workbook as "BOMNAV" on a file that I choose Here is what I have so far but Im stuck.... Sub CopyData()...
  11. P

    Need help please

    Hi all thanks for taking a look and any help provided. The object of this sub is to mailmerge to a word documeny depending on a listbox selection. the sub works fine upto a certain point but having trouble completing it fully with added functions. the sub runs to the end as it stands with the...
  12. C

    File Dialog Excel 2013 Error

    Hi, I have the below code that is working for most of my users but is crashing in the red line for some of the users. The only common trend I've found for those that this is not working is that they are Excel 2013 users as everyone else is Excel 2010. The Excel 2013 users have a run-time error...
  13. D

    User input FileDialog to path for source files in VBA

    Greetings, **What code does:** I have a code that reads the files in a folder, prints the names in the active workbook, and then puts the names in ascending order. **Obs1:** I have follow up codes that use this information for calculations, but this part is not relevant to the current...
  14. A

    VBA Import, Merge & Modify files

    Hello, I have the following code which lets me pick multiple files from a specific folder and then merges all of them together. The code works great, except I ran into the issue where some files had a blank Column A and since the code is trying to find the last used row before pasting the new...
  15. M

    FileDialog.InitialView Property

    Does anyone else share my frustration with the following? Or better still has found a solution? I am using Office 2016 on a Windows 10 64 bit OS. I cannot get the FileDialog.InitialView Property to take effect - i.e. no matter which of the msoFileDialogView constants I use it is not applied in...
  16. A

    Dereference in Application.FileDialog

    I'm trying to have a FileDialog select a shortcut (*.lnk) file, and not the destination file in VBA. E.g. 'C:\MyShortcut.lnk' is a shortcut to 'C:\SomeFolder\BurriedDeep\MyFile.xls' and I want to select the shortcut and update it to 'C:\SomeFolder\BurriedDeep\MyNewFile.xls' MSDN link about...
  17. D

    VBA - Open files automatically in order sorted in folder

    I have a macro that modifies an Excel file and pastes ranges into PowerPoint. However, it opens each file based on windows numbering system: 1 11.1 111.2 2 22.1 I need it to open the files in the order it is sorted in the folder as: 1 2 11.1 22.1 111.2 This is the opening code I would like to...
  18. CsJHUN


    Hi guys! I wrote this, and got some useful info from here(i guess :) ) now I would like to ask you to give me any optimalization ideas (shortening the code, or runtime) The task for this macro are: let user select files via "Open" window open/close each file copy and paste selected datas below...
  19. S

    Get Collection of Files in Folder

    Hello, I'm working on a project that requires me working with files and directories. I haven't had any issues yet with setting up user forms, letting users set file paths to folders or even selecting and importing files, etc... but I'm not sure how to grab all the files in a particular folder...
  20. M

    putting the path from FileDialog into a text box

    So, what I want to do is, allow the user to browse the hard drive, pick a file, and then have the path to that file appear in a text box. I found a popular solution that does something similar: it allows the user to choose multiple files, and it puts the paths for those files in a listbox. But...

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
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 "".
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