I have a number of excel files in a directory that require me to take action after a file has been saved. What I want to do is create a macro that will look to each file and retrieve its 'modified date', then put that into a spreadsheet. What would be ideal is to create a User Defined Function to look at the last modified date of a file in the cell next to it (I have the files names in a spreadsheet as a hyperlink).
I have an excel spreadsheet with multiple file names (including file path) listed in a column. I have to update other files using these 'underlying' files. So each cell has the file path and file name (i.e. Q:FolderFile Name.xls). I would like to have the adjacent cells indicate the last modified date for each file. This saves me time from looking for the last modified date manually across different folders in my servers to see if the 'underlying' file has been updated, which I would need in order to update my other files.
So this function would be something like "get last modified date based on file path". I will need step by step instructions as I am not very familiar with VBA.
A B 1 Q:Folder1File name1.xls 2/10/2012 2 X:Folder2File name2.xls 12/1/2011
I want to know if there is a way to have a cell beside a series of cells that will change its date (and time) when any of the cells in the series is changed.
On a single row, I have four materials that total to a fifth cell. The 6th cell in that row, I would like to have a "date last modified" that would change if any of the first five cell's value is changed.
I have a pivot table for which I load data from a .csv file. Is it possible to include a timestamp on when the .csv file was last loaded. If I do it above the actual pivot table, it just shows when the pivot table was refreshed, but not when the .csv file was last loaded.
I have a workbook that column C has computer names starting from C4 to C83. I need to get the Datelastmodified of a log file that robocopy is writting to the following path. \Server1folder1WorkSheetName\%computername%somefile.log. The Datelastmodified needs to be entered in column K for each computer name in column C. One last thing would also be great is if the file does not exist it would write a error value.
I copied this snippet from the net and it has been working like a charm. I would like to add DateLastModified to it, but I can't get it to work, I'm still kind of new to more complex VBA codes. Here is the code...
Code: Private Sub CommandButton1_Click()
Dim cell As Range Dim selcell As Range Dim Value As String Dim Folder As Variant Dim a As Long
I am trying to find a way for an automatic date stamp to be populated into a field in a row when any other cell contained within the same row is changed or modified. I am hoping that there is an easy solution to this. I have tried searching for this and found a few related posts but I don't know how to modify the code to work for me and when I try to do it, it doesn't work. I have attached an example. I would like column B to populate when I modify any field in the row with the date it is being modified.
I wish to create a macro that looks in a specific directory "D:Records" . It finds the files which are modified after a date "January 01, 2012" in this directory (pdf files). Then it imports these files names into a worksheet.
I have a list that show file names and when the necessary works on these files were completed, but the powers that be want more. I have been asked to add two more columns, one showing when the file was last opened and the other when it was last modified.
Is it possible to do this through VBA without having to open the files that are listed? If so I will run the macro when the workbook is first opened.
I have a spreadsheet that has the date in one cell. I want the date to remain static unless I make a change. ie, when I first create the sheet I want a static date to go into this cell. Then I only want this date to change if any changes are made to the workbook (several sheets), I dont want the date to change everytime I open the spreadsheet. It must however update if I make any changes to particular cells on various sheets.
I've been trying to get this to function correctly. The following code does pull out a list of all filepaths, but what I want to to is access the properties of the file.
Basically I select a customer from a combo box, and from this the code does a vlookup to determine what folder the reports are stored in. The list is then entered onto the worksheet 'FilesInReportFolder'. There is some commented out code as I've ben trying to come up with a simple way to remove the 'xls' from the end of the string, but din't worry about that.
I've found a website that suggests adding .name to the lineto get the name instead of the path, but what I really want is be able to pull out other details about the file.
Private Sub ComboBox1_Change()
Combobox1value = ComboBox1.Value
Dim rng As Range Dim RowNo As Integer Dim NoOfFiles As Integer Dim foundfilepath As Integer Dim FilePath As String
I currently have a macro working where I can populate the A Column with files from a directory and based on its file extension, however I am having problems trying to populate the second (B) column with that files date modified. I have searched the forum to no avail and I must admit I not the best with vba.
Sub INP_files() ' searches within the file location ' C:Arenium_Projects31-1853012_Barnawartha BOSCADDMX Dim rngOut As Range Dim strPath As String Dim strfile As String ' Sheets("INI_FILES").Select
I have manged to search for the last updated file on a folder but i want to use the filename as the source for a copy and paste. it all seems to work bar the linking of the 2 processes the error message 'run time error 9 subscript out of range' is the file is already open should it just not use the same variable to copy the files?
Dim myDir As String, fn As String, a(), n As Long, myFile As String Dim myDate As Date, temp As Date myDir = "C:BarkingEMCIN" fn = Dir(myDir & "*.csv") Do While fn <> "" temp = CreateObject("Scripting.FileSystemObject").GetFile(myDir & "" & ................................................
I just wanted to understand something about some code that was supplied to me on this forum. The code works perfectly, with the exception of one minor issue. The original thread and solution presented is found here
What I wanted was to a function, say, "=LastModifiedDateOf(CELL)", where CELL, is a parameter that indicates the cell I want to monitor. If the value of such cell ever gets changed, the cell containing the function has its value updated to the current date.
E.g. A1 = "AA" A2 = "=LastModifiedDateOf(A1)" -> "10/03/2011 10:30:32"
I need to insert a date modified column to an Excel 2007 workbook I am currently using. The columns range is from A to L, with about a hundred data points. However, I would like to have the date modified cell update only when there are changes to rows F through L, starting with row 3.
I need the code to still function if I add rows, and it would be great if it would also still run if I added columns, but that part is not necessary. I've gotten close by defining a cell name as myCol and using this code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Target.Row < 3 Then Exit Sub
I'm trying to sort all .xls files in a folder by modified date. I want most recent at top because then I will be cycling through and using the most recent version of files that have similar names.
The code I have so far is this:
Code: Sub autolink() Dim folderPath As String Dim FileName As String Dim wb As Workbook
But I need something before it sort the folder by the modified (or better creation date) because there are several files with similar names. I know know, I could put a date in the file name and look for that but I don't control the naming of the files.
I want to amend the ' Date Modified' for a spreadsheet. I have just made changes to it - so the 'Date Modified' shows today's date and time. Is there a way of changing the 'Date Modified' so it shows as yesterday's date?
I needed a code that would input the current date and time in the cells in column N whenever changes were made to any cells in the row from columns A to M. For example, if I change a name in cell 6D, then cell 6N would automatically change to the current date and time.
I found a useful code on a forum (maybe here, don't know for certain) and modified it to suit my needs (see below). I am however now getting a debugging error suggesting that the second line that reads "Private Sub Worksheet_Calculate()" is causing an error.
I'm trying to make a macro that will search a folder and move all files from 2008 into another folder. So far it can do this, but what i need is for it to search subfolders also. At this point it moves all files from the main folder, but nothing from the subfolders.
Option Explicit ' Reference site [url]
Dim objFSO As FileSystemObject Dim objFolder As Folder Dim PathExists As Boolean Dim objFile As File Dim SrcFolder As String Dim DestFolder As String Dim x, Counter As Integer, Overwrite As String, strNewFileName As String Dim strName As String, strMid As String, strExt As String Dim LastModYear