file name

  1. A

    Copy File Name Into Sheet

    Hi I have part of my macro pasted below. The problem I'm having is I'm getting the full path name of the file, which is not what I want. How can i get ONLY the file name itself pasted into cell A1? Set Wbk1 = ActiveWorkbook Fname = Application.GetOpenFilename Set Wbk2 =...
  2. VBE313

    File Name and Path refer to cells

    Is there a way to change the path name depending on what the user types in? I know you can do that with the file name.
  3. C

    Create Macro to Save Active Sheet as PDF and save with in a Specific File Path

    Hi I am trying to create a macro that picks up the file path that is entered on my Spreadsheet and save it as a PDF with in this File Path along with a specific file name: The File Path is below - I need it to go to R1\R2\R3 (S:\Finance\F19\03 SEP 2018) <tbody> Q R 1 File Path S:\Finance...
  4. H

    File names to excel from respective folders

    Hi All, I am working on some automation and need your help in vba code to get excel file names from respective folders......for example ..I have 10 different folders and need the file names those were inside the folder to excel cell starting from A1, A2, A3...so on... if I get the complete...
  5. A

    Run macro w/ relative reference for File name (changes monthly)

    Each month I update/change the file name and have had do manually go in and edit all macros. Is there a way to avoid this? Also, from what I've seen online, many recommend using "ActiveWookbook" or something similar....this will not work for me as I have macros pulling from multiple workbooks at...
  6. I

    SaveAs ilename in Current Directory

    I'm having trouble with the following code. It works perfectly, except that it adds the name of the parent folder at the beginning of the SaveAs filename. The SaveAs file name should be "ParsedInfoData.xlsx", but it is saving as "ParsersParsedInfoData.xlsx". The name of the folder these files...
  7. B

    Combining Files with File Name

    Hi, I have built a VBA macro to combine multiple Excel files into one sheet, format the contents and then do some calculations. However, it would be really useful to have the original file name against each row in the combined sheet. For example, I could see that rows 1-20 came from Sheet A...
  8. E

    Set Const as a dynamic/variable date

    Hello, I have the following code that works well. It searched for a file saved with the most recent date in the file name and opens it. Sub Test() '---Opens a sheet based on date, searches backward from today til it finds a matching date Dim dtTestDate As Date Dim sStartWB As String...
  9. W

    Need a macro to work on any filename

    I have several macros in my Personal Wrkbook. They all do different tasks but look for the file named aging.xls I run different reports and didnt want to give each one a different file name, which is why I name any file I export from our accounting system 'aging' Although this technique works...
  10. S

    only numbers from the file name.

    My filename is like this e.g. abc-253-sffdd.xlsm. I want only the number from the filename as my return value. in the above example I would like my return value to be 253. In below example. drvd951sdfdfd.xlsm is my file name. the return value should be 951. Whatever number is there in the...
  11. weiser386

    Saving an exported chart as the current date file name

    I'm trying to export a screenshot with my macro and I'd like it to save as a date and time format...I think I'm some what close but I need help. Thank you in advance Sub CopyRangeToGIF() ' save a range from Excel as a picture Dim rng As Excel.Range Dim cht As Excel.ChartObject Dim FName As...
  12. M

    Copy and Paste from Excel to Notepad, then Save with Specific Filename

    Hi! I'm working on a program in VBA that requires copying and pasting from Excel to Notepad, and I could use a little help. In another method in the same worksheet, a program automatically generates the contents of a sheet, x amount of cells at a time (it's not fixed, it's based on user...
  13. A

    Paste file name and extension using file explorer

    See code below.... Sub GetFilePath()Set myFile = Application.FileDialog(msoFileDialogOpen) With myFile .Title = "Choose File" .AllowMultiSelect = True If .Show <> -1 Then Exit Sub End If For I = 1 To .SelectedItems.Count Range("K" &...
  14. S

    Macro to save file with its current name but in a different, specified location

    Hey guys - struggling here. I have a macro and I want to end it with saving the file in a specified location - not the current location where I am opening the file from. When I use this macro again, it will always need to be saved at that specified location. However, I want to save it as the...
  15. M

    importing file name to cell

    Hi all, Hopefully this will be an easy one for you guys although I can't find a solution anywhere. I have a simple macro which imports various data from RAW excel files and cleans it into a separate excel sheet. Sub importpart2() Application.ScreenUpdating = False '' SETUP...
  16. 9tanstaafl9

    Find name of external open workbook using VBA

    I need to copy data from an open workbook for which I do not know the name, into my workbook that contains the macro that finds this information. I need to know how to get the name of the workbook with the data. Is this possible? I've searched the Internet for two days now and can't find it...
  17. D

    Finding files that DON'T end in (1)

    Hi, My instrument spits out two text files of raw data. The analysis I need to perform is depended on which of the two files I'm looking at. The text files have the same filename however the 2nd file has (1) at the end. I can loop through half the files using sFile = Dir(sPath &...
  18. O

    VBA - Importing CSV - Start column B; File name column A

    I found a VBA code online to import data from CSV files and paste into the active Excel sheet. I already edited a few parts but can't get the last bit right. What it currently does: - Imports data (2nd row down) from all CSV files in same folder as main file (.xlsx) is stored - Pastes data in...
  19. M

    Macro to Save as PDF - Using:Worksheet Name, Path, & file name in cells

    Hello to Anyone who can Please help, I need to Export to a PDF in the cell Names: 1. Path is cell names - "OneDriveFilePath, & "PCFilePath". 2. File Name is: "FileName". Thx. 4 any help!!! :confused::confused::confused:
  20. C

    Take a folder of file names and turn the list of file names into a spreadsheet - one row per one file name

    Does anyone know how to take a list of file names and dump them into an excel spreadsheet as a file name per row? A lot of times I have a folder of 100 or so policies but I want to manage them with a spreadsheet (so I can tie date last reviewed, owner, etc to the policy name) - I wish to avoid...

Some videos you may like

This Week's Hot Topics

Top