filename

  1. T

    Close A File That Is Open Where You Only Know Part Of The Filename

    Hi all, I am trying to close a file using VBA which in itself is quite simple however the file name changes so I only ever know a part of the filename and its location. Location: P:\Public User Area\Purchasing\Suppliers\National Tube Stockholders\Price Review\ The section of the filename that...
  2. B

    VBA Get the Names of All the Sub-Folders within a Folder

    Hello, I am looking for some help with my Code. I am getting a File not Found error whenever I try to use anything but the root directory "C:" for the PathName. Thanks, CB Sub GetSubFolderNames() Dim FileName As String Dim PathName As String PathName = "C:\Temp" FileName = Dir(PathName...
  3. M

    Paste Vales in same row, different columns

    Hello, I would like to paste 3 values in 3 columns A, B, and C in the last available row. Filename = Dir(Path & "*.xls*") DateTimeStamp = DateTime.Now UserName = (Environ$("Username")) 'get last AVAILABLE cell to paste into Set iLastCellS2 = s2.Cells(s2.Rows.Count, "A").End(xlUp).Offset(1, 0)...
  4. J

    Create .csv file from a workbook sheet with new filename and timestamp

    Hi all, Im not great at VBA by any means but since moving to mac I cant seem to do anything i used to do with ease. I am simply trying to create a macro that copies a sheet in my active workbook to a new .csv file with that sheet name as the title and todays date and time in the newly...
  5. E

    Open Multiple files with loop

    I have just upgraded my excel on my mac and have problems with my code and the GrantAccessToMultipleFiles and looping through the excel files in my directory. When the Set wb line executes, I get a Run-time error 1004. Additionally, I want to access a large number of files (>100) in my directory...
  6. R

    Macro Loop?

    Hi I am trying to test this on a folder containing 5 files, it opens all files but it only completes the action on 1 file then seems to freeze excel completely. I am new to the world of Macros and lifted the code from a website, so I am hoping this will be a good way to get an answer. Have I...
  7. D

    e-mail loop macro

    so I have the filename in column A, and e-mail address in column B and C column A a_Cass,Mass_Chen,Victor_ column B cass.mass@x.com column C chen.victor@x.com ..... is it possible to make an e-mail macro that will loop through each filename listed in column A and create an e-mail for...
  8. J

    Dir Do Until Loop not working

    Hi guys! I have this for loop iterating through each folder in a file path, then it goes into the folder and gets the names of the files. Only problem is that while it should be getting the name of every file in each folder, it only gets the name of the first file. So I though a Do Until loop...
  9. S

    Read File Based on Date VBA

    Hi. I need to read a file, based on latest date. Using VBA. I really don't know how to do since before this I only put exact name of the filename. I know how to do it using vb.net, I do like this, Dim stamp As String = DateTime.Now.ToString("yyyyMMdd"...
  10. N

    Outlook VBA

    Hi All, I want to automatically download attachments I receive from work to a folder on my computer. Currently, I have it downloading everything in my inbox but I want to set parameters so it only downloads the prior weeks attachments from the current day. This is what I have so far: Option...
  11. W

    Problem Saving to File Name

    Hi All, I wrote a macro that will loop through all open workbooks and save each and print each to pdf. It saves fine and it prints to PDF fine but it makes me enter the file name of the pdf manually. I would like it to use the filename for each workbook as the filename for each pdf file...
  12. R

    [VBA] RE GetOpenFileName, I want to point Excel to a file, and then reference that in other modules

    Hi all, Doing a new sheet for reporting, I want to report on a campaign. Let's say our campaign is called "70. London" I use GetOpenFilename to point Excel to this, and then reference that file as 'facml' So now when I talk about facml in that module, it knows the file name and location, so...
  13. R

    GetOpenFileName, then display that Filename in a box?

    Hi all, have a box with a button next to it, the idea is, user clicks the button which opens the directory where the Mailing Lists are stored, then the user selects the Mailing List and it stores the path + filename as "facml" I then want the box to fill in *just the file name* Here's my code...
  14. U

    VBA Batch Renaming of Files

    Hi Excel Gurus, I'm looking for some post here regarding naming of files but can't find a suitable one. Basically I have these folders on my documents: Folder 1: Math Folder 2: Science Folder 3: History Inside the folders are different files like in the form of PDF, Excel, Text,jpg and Word...
  15. D

    Run-time error - type mismatch

    Hello everyone, I'm attempting to search through Outlook to find an attachment that is given a unique name with a date. However, there is part of the filename that is the same all of the time. I'm receiving the error on the line where I'm setting the sPath. I've got other code, that should be...
  16. E

    Is it possible to specify the path and filename of an xls file and use it as a reference without opening it?

    Is it possible to specify the path and filename of an xls file and use it as a reference without opening it? In VBA or formulas. Thanks!
  17. I

    Importing External Worksheets and Renaming Them

    Can someone please point me in the right direction. I have dozens of workbooks in a local folder where I need to import a specific worksheet "General Ledger" into the current workbook. The code I wrote does open the workbooks but seems to break when it gets to "total" even though when checking...
  18. K

    Save Workbook in particular folder.

    Hello. I wish to save a new copy of my workbook as a .xls file into a particular folder using a new filename using current day logic. My current file is a .xlsm file. The filename I wish to save as: 101 My P&L 28 May 2019 The underlined parts of my filename need to update everyday...
  19. B

    Rename File from Hyperlink on a Sheet in Excel VBA

    I have a sheet which lists many relative hyperlinks. The 'text to display' is the filename. Using the 'Worksheet_Change' event to monitor, if a user changes the filename in the cell the actual filename should be renamed to the new value, so the user doesn't have to open the folder and manually...
  20. W

    Trying to merge workbooks in a folder, but converting from a full sheet to a range

    I’m looking for some help in converting my current code into a range instead of a full sheet Instead of merging sheet 1 from multiple workbooks into a master workbook, I only need to copy a specific range on sheet one of each workbook and paste it within the master workbook. I need each sheet...

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