Checking File Created And Modified Dates

Apr 17, 2007

Is there a way I can check an excel workbook's created and last modifed dates using a macro in that same workbook?

View 3 Replies


ADVERTISEMENT

VBA - Generate Date Range Within 2 Supplied Dates (Modified)

May 11, 2009

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

View 2 Replies View Related

Function To Return Last Modified File

Dec 22, 2008

I don't really know VBA more than just piecing together other people's work (so please dumb down your responses as much as possible).

So I would like to have a function that displays a filename within a cell. The filename I need to display will start with "cost" and have a date at the end (not always the same number of characters). I need to search a folder for all files that contain that text and return the last modified one.

I found this VBA code that returns the last modified file, but only filters based on the extension (which I would like to keep in the code as well).

View 11 Replies View Related

File Date Last Modified From Cell Value

Feb 26, 2013

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.

View 1 Replies View Related

Date Modified Of Text .txt File

Jan 8, 2007

I need to be able to find out which of two .txt files were most recently modified, the two txt files are of fixed name so I can hard code these.

View 2 Replies View Related

Open File Depending On Name And Date Modified?

Aug 6, 2014

I have this code, it's working to open the last modified file but how can I implement that it also opens a certain file name.

examples
Test1 150126.xls
Test1 150128.xls
Test1 150140.xls

the numbers are the time the file is saved, is it possible to also look at file name:text1 and then look at the last modified file So only fill in the file name and the macro opens file: Test1 150140

[Code] .....

View 5 Replies View Related

Showing File Last Modified Date In A Cell?

Sep 21, 2009

if there's any sort of script which allows the file's last modified date to be shown in a worksheet?

View 5 Replies View Related

Open Latest File By Date Modified

Feb 29, 2008

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?


Option Explicit

Sub Get_Availability_Data()

Application. ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False

Dim wsTo As Worksheet, wsFrom As Worksheet

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 & "" & ................................................

View 9 Replies View Related

Vba For Checking Dates

Sep 21, 2009

Is there a code in vba, that will return today's date (or the date of the week before, [today-7]) I need a vba code that will check a current cell - let say cell "A1", that contains a date( for exmpel: 12/7/09), and compare this date to the date last week, if the cell (A1)contains a date that is older then last week , then fill in A2 with "False", if the date in A1 is between the date of today and a week ago then fill A2 with "True". (For the exmple that I gave of course in A2 the value will be "False")

View 2 Replies View Related

Displaying Last Modified Date And Time Of File In A Cell

Jul 11, 2009

How can display the last modified date and time of my excel file in a particular cell - Say in cell E1.

This is the same value that we get when we Right Click excel file->Properties->General and look at the label "Modified".

View 8 Replies View Related

Adding Date Modified To PDF File Extracting Macro

Jul 3, 2014

Below Macro which I am using to extract .PDF files. Now, I also want to see the Date moified while extracting the .PDF files. Hence, adding date modified to this macro.

Sub get_pdf_name()
Dim FR As Long, sh As String, FPath As String, FName As String
sh = Sheets("Sheet2").Name
FR = Sheets(sh).Range("A" & Rows.Count).End(xlUp).Row + 1

[Code] .....

View 1 Replies View Related

Checking Two Dates On Userform?

Apr 4, 2014

I've got two text boxes where users input the dates in specified format (dd/mm/yyyy). current validation checks whether one date is not earlier than the other one and it looks like this:

[Code] .....

However if they are equal which suits me I am still getting an error. don't need a calendar btw

View 2 Replies View Related

Checking Dates Between Range

Jun 18, 2012

In our program it is essential that only data is entered for the current week.

I need code that if a date is entered into "cell C1",that it will evaluate this value and compare and assure that it is between the dates in Range D1:E1 (upper and lower values)

If it is between these two dates, nothing happens and you can proceed to enter data.

If it is not message -Invalid date entered. Proceed? If "Yes" nothing happens and you can proceed to enter data! If "No", then the value in cell C1 is set to nothing and allows you to enter the correct date.

I need to be allowed to enter an incorrect date at times,to review and check previous entries, 99% of the time it must be between the start and stop date.

View 1 Replies View Related

Modify/Edit File Properties (Date Modified) Of Workbook

Apr 8, 2008

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?

View 3 Replies View Related

Sumifs Formula For Checking Dates

Jun 1, 2014

I have a SUMIFS formula that I am having trouble with. I am trying to check the following:

=SUMIFS(NFCU!$G$5:$G$298,NFCU!$E$5:$E$298,NFCU!$H$2,NFCU!$A$5:$A$298,"<e1")

The range NFCU!$A$5:$A$300 is a column of dates. The evaluation of "<e1" does not seem to evaluate. However, when I change "<e1" to a date value of 41760 it works. How can I reference a field rather than the raw value?

View 4 Replies View Related

Checking Multiple Range Of Dates

Feb 17, 2010

i need to check a date within a multiple range of dates using certain key.
i've tried vlookup, but failed to get correct answer.

here is Table1
product (cell=A1)
date (cell=B1)
plan(cell=C1)
A
20080801
A
20090801
A
20090901
A
20090831
A
20090101
A
20091101.....................

View 9 Replies View Related

FileSystemObject: Finding The Last Created File

Dec 16, 2008

I have tried to use the "FileSystemObject", but i just dont understand the concept around it.

The reference to use it as been selected.

In time, this directory maybe huge, so i want a fast macro to find out the name of the last created file.

View 9 Replies View Related

Checking File From FTP Site

Mar 15, 2012

I have tried to search these forms for some information on how to have VBA code check a file saved in an FTP site. I am hoping to use this file to contain version information where the workbook code will compare the version of the workbook to the version log saved in a text file on an FTP server. If they are different, I would like a pop up window to appear that notifies the user that there is a new file available, and perhaps a prompt to save that new file to the user's computer (it does not need to update and replace current workbook).

Is it possible to have VBA check an FTP site for this if I put the username and password in the code?

View 1 Replies View Related

Newly Created File Not Saving At The Given Location

Jul 1, 2014

I have an issue with saving the file at the desired location below is the code i have currently used . I have given the destination as "D:New folder". The new file does get saved at location "D:" but not inside the "D:New folder", instead names the file as "New folder".

View 3 Replies View Related

VBA To Check Version Of Created XLSM File?

Jun 21, 2013

I'm creating a template xlsm file that has built in marcos. This file will be used by the Engineer as a template, where they fill in the data, and then send it to the team. when the case in finished, they will use clear data macro.

The Problem I want the template to have a macro runs with startup of the file that checks for the lastest template in a network folder (shared folder where they will have read only access). If the used file is the latest one, OK. If not, give a custom msg with the location on the network.

View 6 Replies View Related

Can VB Open The Most Recently Created File In A Folder

Sep 13, 2006

I have a folder called 'Refresh'. Every week a new file is dropped into that folder. Instead of me placing that new file into my workbook, i would like my macro to just grab it. Is there a way for VB to grab the most recently created file that comes into my 'Refresh' Folder.

View 9 Replies View Related

Checking Open Excel File In VB6

Nov 8, 2012

I seem not to be able to solve, regarding an Excel VB6 integration.

I wish to check if a specific Excel file is open at any given time (I'm using a timer for this.)

This is what I had so far, but I need it to be checking prior to this and I don't like this solution really (wasn't complete.)

Code:
Private Sub Command1_Click()
Dim oXLApp As Excel.Application
Dim oXLBook As Excel.Workbook

[Code]....

View 5 Replies View Related

Checking If File Open.txt Then Close

Feb 25, 2009

I need to check if a .txt file is open. If yes, need to close it.

View 9 Replies View Related

File / Workbook Created By Macro Is Making It Heavier?

Jul 4, 2014

I am creating 4 Sheets from a Main Sheet by Filtering Data based on different values in a fixed column, then the Filtered Rows are automatically pasted in the respective sheets.
Then these 4 Sheets are creating another file.

The same thing done manually by Grouping the 4 SHeets and then Move Copy into a New workbook also makes the file heavier.

Everything works fine however though the data is not much the file is very heavy, so what do i do to make it of appropriate size ?

View 1 Replies View Related

Remove Inverted Commas In PIPE Delimited File Created From VBA

Jun 3, 2014

i have a Macro, its creating unwanted inverted commas at the start and end of the File.

File:

"SunilManual|123456790|DrivingLicence|908567543|Sunil|Manchan
|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w
|w|w|w|w|w|w|w|w|w|w|w|ww|w|w|w|w|w|w|w|w|w|w
|w|w|w|w|w|w|w|w|w|w|55|55||4|SR-1161||1234567890"

Expected File:

|SunilManual|123456790|DrivingLicence|908567543|Sunil|Manchan
|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w
|w|w|w|w|w|w|w|w|w|w|w|ww|w|w|w|w|w|w|w|w|w|w
|w|w|w|w|w|w|w|w|w|w|55|55||4|SR-1161||1234567890|

VBA:

Option Explicit
Sub txtt_export()
Dim buf As String, col As Long, r As Long, ws As Worksheet

[Code]....

View 2 Replies View Related

Excel 2007 :: SharePoint / Checking File Status

Jun 11, 2014

I'm working with a file from SharePoint (FileA), "FileA" goes out to Sharepoint and opens "FileB" (if not already open) then copies information from "FileA" to "FileB". However if "FileA" is left open, or someone else has it open I am unable to open "FileA". How in VBA can I check to ensure I don't have it open locally (if so swich and continue), checkout and open in SharePoint (if not already open) or Prompt with options to force checkin, checkout to copy info?

Simple VBA copy I used:

Workbooks.Open FileName:= _
"http://sharepoint.baaa.com/sites/SCDT_DSD/Weekly_Releases/11.%20Combined%20Weekly%20Task%20List/1/Automated_Status_Update.xlsm"
Sheets("1").Select
Range("A1").PasteSpecial Paste:=xlPasteValues

View 2 Replies View Related

VBA Count File Which Modified Date Matches Fixed Date

Jan 9, 2014

I've written a Function which will count the number of files in a folder which the modified date equals a fixed date

For example, here, I want the file count which modified date = 01.01.2014

Code:
Function FileCountDate(Path As String, FileType As String) As Long

Dim strTemp As String
Dim lngCount As Long

Application.Volatile
strTemp = Dir(Path & FileType)
Do While strTemp ""

[Code] ......

However I got a #VALUE! error message with this formula:

=FileCountDate("C:Usersjohn.doeDesktopTEST","*")

In the TEST folder there are 4 pdf files so it should return the value of 4.

View 2 Replies View Related

Non US Date Format For Dates In CSV File

Oct 21, 2007

I am using a CSV that has the date in Column A in the format of DD/MM/YYYY. When I open this CSV using a VBA comand the Format of the Cells in this col are then formated as either Date or General. The general format happends when the date cant be turned into US format and when it can then the date is turned US and displayd as such.

SO
14- Sep = 14/09/2007 as General
10- Sep = 09/10/2007 as Date

Im in Australia so the correct format is DD/MM/YYYY. Microsoft has issued a fix for this using Local:=True in the file open comand which is all good and well as it works unless you have office 2000 when it crashes. What would be the best way of fixing this, so that the Dates are all correct or the col is all the same format?

View 4 Replies View Related

Stop CSV File Converting Numbers To Dates

Jan 14, 2010

I'm having a little problem working with some CSV files that are sent to us by an outside party. There is a field for an invoice number. This number should be a string since it sometimes has alpha characters and sometimes has dashes. But the field is not delimited to indicate this, so when opening these files in Excel, Excel will sometimes convert the numbers to dates. Once they are converted to dates, there is no going back.

The way we have gotten around this is to change the csv extension to txt, then open as a txt file and convert that particular column to a text column. This causes a lot of additional work as the file ultimately needs to be converted back to a CSV.

Ideally, the people creating the CSV files should create them so the invoices column is properly delimited. But that doesn't seem to be possible right now.

Is there a way to create a macro that would make the modification while opening the CSV file, before Excel has a chance to modify those fields?

View 3 Replies View Related

Stop Excel From Changing Numbers To Dates In CSV File?

Jun 6, 2005

When opening a .CSV created from a third party software, one of the columns is converted to date format. The numbers are imported in #/# format. and Excel changes most of the numbers to 2-Jan, 3-Jan etc... This would not be that big of an issue if I could simply set it back. Clearing format or changing to text converts it to a 5 digit number.

The only way I have found to get it to work properly thus far is to open a blank sheet and import data and setting the column to text prior to import.

I would like to find a way of opening the CSV file without all the extra steps. Is there a setting that can be turned off?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved