1. A

    Can't get the script to consolidate data side-by-side

    Hi everyone, I'd really appreciate if someone helped me with this problem. Admittedly, I'm very new to all this so please go easy on me. I have a code that consolidates data from a large number of workbooks to a single master worksheet. I'm targeting same cells from different workbooks (for...
  2. D

    Fails to Attach file

    So this is a piece of code, that runs in a different workbook, as part of the same system, perfectly fine. However will not function as required in this workbook. This doesn't throw an error, but when hovering over "ActiveWorkbook.FullName" in the .Add code, it shows as <automation error=""> I...
  3. C

    vba to save wksht as PDF but remove disallowed filename characters first

    Hi, I have the following code that saves an excel worksheet as a PDF and give the user the ability to change a pre-defined filename using a cell value. Can I have the code so it automatically changes a / (fwd slash) in the pre-defined filename to a , (comma)? Thanks Dim Opendialog As Variant...
  4. E

    Pull File Name from Looping Files

    How do I pull a file name from a file being looped from a batch of files? I have a folder with a bunch of Excel files that I extract data from. The extracted data is consolidated into a single tab on a separate spreadsheet, which is located in a different folder. I would like to know which...
  5. H

    Vba does not want to Kill the Last File in the Directory

    Hello, I have a code that when it is clicked it finds all the jpg files in a directory and places there Names in an Array then deletes one by one with Kill. Everything went fine until the last file where I get an Error 53 "File not found". I checked and the file is there. So I changed the...
  6. H

    Does the Upper Bound of an Array of Files Names always represent the Newest File

    Hello, I recently started using arrays in vba. My second array is a Single Dimension Dinamic Array that populates the array with a String of jpg file names in a directory. I just have two questions: 1] I noticed in the Local Window that the Upper Bound of the array is the Newest Files...
  7. T

    VBA code that will check all files in a directory, copy the contents of the first sheet, and paste it on the first sheet of the main excel file

    Hello Mr Excel team. I have this code Sub FetchName() Dim directory As String, fileName As String, sheet As Worksheet, i As Integer, j As Integer Application.ScreenUpdating = False Application.DisplayAlerts = False Workbooks.Open ("c\text.xlsb") directory = "c\test\test\" fileName =...
  8. S

    VBA save file with path and name defined by cell value

    Hi all, I searched around but could not find an answer to my question. Looking for a VBA that will save my file with a file name defined by cell A1 to a path defined by specific network path and folder name in cell A2. Tried several versions of codes I found online, but cannot find all the...
  9. N

    Extracting attachment filename in lotus notes using VBA

    Hi, I am new to lotus notes automation using vba. I have a requirement wherein I have to loop through all the mails in the lotus notes DRAFTS folder and copy the filename of the attached file into an excel sheet. HELP!!! Thanks in Advance..
  10. L

    Detecting change in Save As filename before hitting OK

    Hi everyone, Maybe a cryptic Title but I'll explain: I Use "Application.Dialogs(xlDialogSaveAs).Show(filename)" (containing prompted filename) to open Dialog window Save As. Now, I want to detect if that filename in an way is changed before hitting "OK" to save (actually I want to prevent/stop...
  11. J

    VBA to activate workbook opened from email

    Hi, I have written and tested code which works brilliantly (Not to brag) and I have sent the file to all in my organisation to use. Part of the functionality is to email me a copy of their file. I then run another piece of code to copy data (theirs and mine I enter) from the emailed workbook...
  12. N

    Macro save Excel workbook as pdf

    Dear All I'm trying to write a macro to save an excel workbook (3 sheets) as a pdf file. My Code is Sub Macro1() ' ' Macro1 Macro ' Dim Path As String Dim Filename As String Path = "/Users/NeilDavison/Library/Mobile Documents/com~apple~CloudDocs/NEMC/Invoices/2018/" Filename =...
  13. Johnny Thunder

    VBA - Add "On Error Resume Next" to my working code"

    Hi guys, for the life of me I can't figure out how to add an "On Error Resume Next" line into my working code. I have a macro that opens files in a directory and if it finds a specific tab name it deletes it, in the event the tab does not exist I want it to close the file and open the next...
  14. G

    Open and copy all data from from dat file in a specified folder, but exclude if file name listed in worksheet

    Hello there I have a vba code which works perfectly... it opens and copys all data from any DAT file located in a specified folder (C:\Junk) to a worksheet called 'download' and also stores the name of any DAT file it has processed in a worksheet called 'Processed_Files' However I need the...
  15. sharky12345

    Convert date to different format

    I have a date in a cell which is formatted as "dd/mm/yyyy" but I need to use that date value as part of a filename later, so want to convert it in VBA to "dd_mm_yyyy". Can someone show me how please?
  16. N

    Filename as Cell value

    I'm trying to create a macro to save an excel file as a cell value. Sub Macro2() ' ' Macro2 Macro ' ' Dim Path As String Dim filename As String Path = "/Users/NeilDavison/Library/Mobile Documents/com~apple~CloudDocs/NEMC/Invoices/2018" filename = Range("JobNumber").Value...
  17. G

    Delete File by Creation Date

    Hi, I am currently using the code below within the "this workbook" section to save a file to one location and also create a backup copy of a file to a different location adding the date to the end of the filename. "filename dd/mm/yy.xls" Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean...
  18. O

    Copying from one workbook to another VBA paste values only

    I have 2 workbooks, DTR Index and DTR Template. When the DTR index is completed I need to open the DTR template and paste the values from one range to another, then save as a new file name. I was partially there but it doesn't seem to want to work - I get a Run time error 91: Object variable...
  19. M

    Getting data from multiple workbooks (+200) using Index & Match in VBA (?)

    Hi all, This is my first post on this forum, you guys already helped me a lot by answering other people's questions. But now i can't really find a solution. We have on a yearly basis, a total of 208 workbooks (1 for each hal, p. week) now i want to extract a certain field of data to a...

Some videos you may like

This Week's Hot Topics