myfile

  1. P

    Read 2 files and save in 1 worksheet

    https://pastebin.com/raw/YAYfZ99AHello. I have little trouble. Im really green in VBA but i know about it can be dont in VBA. I have 2 folders with tons of txt all txt have the same name in 2 folders but having another data. ex. Folder1/1.txt Folder2/1.txt Folder1/2.txt Folder2/2.txt Example...
  2. Y

    Import data from already opened workbooks

    Hello all, I have a small code that opens the files in a folder, after asking me when the names should contains. Sub OpenFiles() Dim MyFolder As String Dim MyFile As String Dim MyName As String MyFolder = "C:\Users\xxx\Desktop\New folder\" MyName = InputBox("Please enter name to...
  3. Y

    VBA - Open files from folder

    Hello all, I am searching for a vba code to open all xls files in a folder if the name of these files contains a specific text. It would be great to ask me when name i am searching, when run the vba. I made one that opens all files, but... Sub OpenFiles() <code spellcheck="false"...
  4. B

    VBA code to copy values from same cell over multiple workbooks into one

    Hello All, New to this forum and looking for some help. I have the need to copy the values from the same cell in multiple workbooks in the same folder into a master file. I have come up with some basic VBA code that will sum the values of the same cell over multiple files and place that total...
  5. T

    Need help with VBA Sub routine

    I have been away form VBA coding for 10 years and am having a problem. I have copied and adapted this subroutine from a google search. It worked 3 days ago, but now is not finding the files in the same folder. I need help in determining why. The part that errors shows a Msgbox with "Run-time...
  6. Y

    Open a Work Book where the name is variable

    Hi. I am looking for a way to open a work book that is in a constantly named folder but the name may alter. i.e. Roof V4.1.xlsm but a later version could be Roof V5.6.xlsm The path to the folder won't change, just the file name. I have tried to make it a string so I can use a wild card but it...
  7. Y

    Help with finding WorkBook from folder

    Hi. I am having a problem with a macro looking for a file with a variable name. This is the code. [vba] Dim MyFile As String Dim strFilePath As String strFilePath = Range("E11").Value & "Quoting Files" MyFile = Dir("Foundation*") On Error GoTo Error_handler: ' all...
  8. G

    How do I amend a macro to check if read only

    Hi I have the following macro but im trying to get it to notify me if its read only when opening. How do I do this and can it be tidied up? Declare the variables Dim MyPath As String Dim MyFile As String Dim LatestFile As String Dim LMD As Date 'Specify the...
  9. theboyscout

    Schedule email from list

    Hello, I'm trying to create a script that would search a folder, find the last inserted spreadsheet, locate a field and if that field is > 0 send an email. And this is to be run weekly. <tbody> F L O Descr Email Available_Spots 60749 jon.snow@got.com 1 </tbody> I've scraped up a...
  10. M

    Macro to pull data from multiple workbooks

    Hi everyone - I am trying to create a macro to pull a specific cell from multiple workbooks. This cell will remain the same throughout (A1). The issue I am running into is when the macro is ran it does not immediately identify the sheet. When ran it will force you to select the correct sheet...
  11. S

    Activate an Open File

    Hey Guys, I am looping through a directory of files I need to modify. I copy daya from the open file to a temp file, modify it then copy that data back into the source file. Not the most elegant process, but easy for me. The problem I have is activating the source file again after working in...
  12. CatLadee

    VBA: Loop through files in a folder and perform vlookup on two columns in each file to pull in data to a master file

    Hi all, Appreciate your help in advance. I have this code and it's purpose is to loop through files in a folder to open them up. From there, a master worksheet will vlookup values from two columns to pull in the cells values where they match the HASH ID (in both files). How do I setup the...
  13. S

    Macro VBA loop through, convert column to text then to general formatting

    Hi All, I have written a code to try and format A:12 down to general from a date format. I have since discovered the code wasn't working as I need to use the "column to text" function. I have tried a few methods to get the code right (including recording) but when i actually run the macro it...
  14. T

    Excel VBA importing multiple excel files from a folder

    Hello, I'm trying to import a random ammount of excel files into a new excel file. I used the vba code from this thread as a base: https://www.mrexcel.com/forum/excel-questions/1052154-excel-vba-importing-multiple-csv-files-folder.html Sub ImportCSVData() Dim wb As Workbook Dim wbCSV As...
  15. R

    Downloading a PDF using VBA

    I am trying to download PDFs from a web link. I have the below code which works when I test it with the below links. However for the website I actually need it to work it doesnt. It downloads a pdf file but then say it cant open the file because it doesnt support the file which doesnt make sense...
  16. S

    msg box help!

    Hi i have the following code to grab names from a folder i specify, however how can i have a message box that tells me the number of files name returned back? Sub FetchNames() Dim myPath As String Dim myFile As String myPath = Range("H2") myFile = Dir(myPath & "*.*") r = 2 Do While myFile...
  17. B

    Help with VBA ....Please

    Hi guys, I was hoping you can help. I have the below VBA macro running in a master file (named ZMasterFile). The idea is I have this file in a folder where up to 100 excel workbooks are stored and I use it to extract some data from each of the workbooks and collate on the ZMasterFile. It is...
  18. B

    Removal of Duplicates when re running the report

    Hi Guys, I hope you can help - The below is something I have built out to grab data from about 90 workbooks. The challenge I have is I need to run this each week as the data updates however this duplicates the data and I would like it to avoid this so that it only reports on the latest data...
  19. R

    Excel VBA - Loop through files and make changes to names and file type

    So I am trying to loop through all the files in a folder and make either changes to the extension, the name or both. I have code (see below) and the problem is that it is only looping through files with extension ".xslx". I need to make changes to the names of all ".pdf". I need to make...
  20. E

    Search for a file on using wild cards VBA

    I am attempting to search for a file using wild cards but am having trouble making it work. I get the Run-time error '52' Bad File name or number Here is my code Sub OpenFiles() Dim MyFolder As String Dim MyFile As String MyFolder =...

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