filepath

  1. D

    VBA to create a folder name with the date for Monday and Friday separated by a hyphen?

    Hi Folks, I have found a great macro which allows you to check for the existence of folders in a file-path matching: Year, Month and Day (i.e., creating the folder if it doesn't exist). For instance, if the FilePath starts: C:\Temp Time Sheets\ it checks for C:\Temp Time Sheets\2019\ C:\Temp...
  2. G

    ChDir path problem

    I have been using a macro successfully for sometime now, but I have just bought a new machine and I am running W10 and 365 E3 and now the macro will not see the path of the file The files are all stored in the cloud (Office 365, OneDrive for Business) but are also synced with File Explorer When...
  3. Q

    PDF Created from VBA Button won't open

    I've got this code below which creates a PDF document. The error message appears saying I'm unable to open the document because: it is either not a supported file type or because the file has been damaged VBA Code: Private Sub Command273_Click() Dim wdApp As Word.Application, wdDoc As...
  4. P

    VBA loop with wildcard in Sheet name

    Hi All, I'm pretty new to VBA, this is my also my first time posting on here. Hoping somebody can help me tweak my code; The code loops through all the files in a folder to copy data from a sheet called ("P&L 2019 - UK GAAP") into one workbook. The issue that I'm having is that, a couple of...
  5. G

    Copy Multiple sheets to new workbook

    Hi everyone, Here i am trying to copy multiple worksheets to new workbook and below is my code Option Explicit Sub Save_File() Application.EnableEvents = False Dim FlName As String Dim FilePath As String Dim newfilename As String FlName = "Copy" FilePath = Cells(2, "K").Value...
  6. H

    VBA Saving excel with some constrains

    Dear All, I have seen the great value of this website I'm not really experience with VBAbut relaying too much on MREXCEL i'm adding a code to for a button on the excel so when you click on it It should openthe saving as box with a specific name reading form a cell I found the acode but my...
  7. J

    Reference another workbook with entire filepath

    Hi All: I am trying to write a formula to reference cell A1 in this workbook. I am using the entire filepath in hopes of being able to access the data without the other workbook being open. C:\Users\Username\Documents\Report\[Test Workbook.xlsx]Sheet1 Any suggestions?
  8. L

    Excel power query

    HI all, I've generated a query from a folder containing dozens of workbooks. I'm using table 1 from each workbook, in the query editor I have all my data including the source workbook, but I want to add the filepath to each row. How to I add an extra column with the filepath inside the...
  9. F

    Copy sheet in filepath and paste into another sheet in another workbook

    Hi I have a workbook with a filepath that has another workbook with a sheet i need to copy and paste. So Workbook “A123” has filepath in cell D42 and I need to open that filepath and copy the specific sheet called “Master Sheet” and paste it into another sheet in workbook A123 called “Allocation...
  10. B

    Macro not pulling the correct data - Help!

    Hi Guys, I hope you can help with the below macro. It runs well as long as Sheet1 is visible (Ideally I'd like it to work even when sheet1 is hidden) however I've also now noticed that it's actually pulling the data from the last tabbed saved in the workbook rather than referencing Sheet1. So...
  11. B

    Running VBA on hidden worksheets

    Hi All, I currently run this macro on multiple documents in a folder. What I'd like to do is hide the worksheet - Sheet1 but still allow the macro to run. Can anyone help with the below to allow the macro to extract the data from sheet1 whilst the worksheet remains hidden Many thanks, Paul...
  12. K

    Move sheet

    I am trying to move a sheet from activeworkbook to a file that is stored in a folder. Any help is greatly appreciated, I have attached the code that i am currently trying to use. I feel that i am over thinking this. Sub move_sheet() 'Move the active sheet to the end of named Workbook...
  13. M

    Tweak to speed-up macro

    Hello, I am using a macro to rename all my file in a folder with a specific cell value, the macro also rename the sheetname with the same cell value. It works fine for what I need, the only drawback is that the macro is sometime terribly slow. 1) Could someone give me some tweak to speed-up a...
  14. J

    Using filepaths in VBA code - files located on DropBox

    Hello and thanks for considering an issue I'm bringing up. First off - this is relevant only to files stored on DropBox or, very likely, other cloud storage platforms. And only due to the files being accessed on different computers. The problem appears to be that Excel typically uses absolute...
  15. A

    Run a Macro for multple spreadsheets at once

    I'm wondering if there is an easy Visual Basic program that can do this: I have multiple spreadsheets (any where from 1 to 300 on any given day). For each of these spreadsheets I need to run the same Macro and then save the result in a specific folder. Is there a way to do this in a batch where...
  16. 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...
  17. 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...
  18. D

    Copying sheets to existing workbook, workbook name is cell.value

    Hi all!! Very new here. Having a hard time to debug.. I am currently trying to make the macro work as the following: create new sheets and rename it to cell.Value in range, and if there is a workbook (also named as the sale cell.Value) in the same folder as the macro, copy this sheet into the...
  19. B

    Save as

    Evening Looking to remove the .xlsx from the export to PDF in the below script. Thanks guys Sub PDF()Dim wb As String Dim filepath As String wb = ActiveWorkbook.Name filepath = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & wb & ".pdf" ActiveSheet.ExportAsFixedFormat _...
  20. B

    Run Time Error

    Afternoon Is there a work around to the below seems to work well in other scripts. The error occurs at the ThisWorkbook.Activate Thanks All... Dim filepath As StringSet wb2 = Workbooks.Add ThisWorkbook.Activate ActiveSheet.Copy before:=wb2.Sheets(1) wb2.Activate filepath =...

Some videos you may like

This Week's Hot Topics

Top