VBA – Including Date In Filename

Mar 22, 2007

I’m trying to save a new workbook with the current date included at the end of the filename, in the format yyyy-mm-dd.

I took a guess at the following but it doesn’t work - the filename comes out as 'Report39163' Can anyone help please?


ActiveWorkbook.SaveAs Filename:="\UsersDataTemp" & "Report" & Format(Date, yyyy-mm-dd) & ".xls")

View 9 Replies


ADVERTISEMENT

Calculate Number Of Days Between Two Date Within A Current Month Including End Date

Apr 2, 2009

I have two columns of dates, leave start and end dates (when people start leave i.e. annual leave). Would need to introduce column(s) to calculate how many days fell within the month including the end date and excludes weekends.

For example, if the staff on leave from 31st March to 6 April, i need to show that the number of leave taken as 1 day in March and 4 days in April.

View 9 Replies View Related

SumIF With Dates: SUM All Expenses After The Posted Date Including That Date

Feb 13, 2009

In the expense log, Column C is a list of Dates and Column I is a list of expenses. I want to Sum the expenses in the 'Expense Log 09' to a new sheet based on a Date entered in H24 on the new sheet. I have tried the formula as shown below and Get the result #NAME?

=SUM(IF(Expense Log 'Expenses Log 09'!C8:C100,H24,'Expenses Log 09'!I8:I100)). I would Like to SUM all expenses After the posted date including that date.

View 5 Replies View Related

Add X Workdays To Date Including Saturdays

Apr 30, 2008

How to add 2 "working days" to a date, including Saturdays as work days, and excluding holidays and Sundays? Similar to: = WORKDAY ("01/02/2008", 2, 39451) But instead of resulting in Mon Jan 7th, the answer should be Sat Jan 5th. (39451 is Fri Jan 4th.)

View 4 Replies View Related

Get Date From The Filename

Jun 18, 2014

I have a filename 'filename-12-14-2014' where i need to extract date information from the filename and insert a new heading in the file 'date' in the first column and write the extracted date till the end (until data exists). I can write the new column name but i could not write date in all the fields. code i wrote is below

this is for extracting date from the filename. the 4th lines throws me the error?

(1) LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
(2) With Range("A2:A" & LastRow)
(3) x = Split(s, "- ", 2)
(4) .Value = Left(Mid(x(1), InStr(x(1), "-") + 1), InStr(Mid(x(1), InStr(x(1), "-") + 1), ".") - 1)
(5) .NumberFormat = "mm/dd/yy"

for adding the date in the first column. This works fine

Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "Date"
s = ActiveWorkbook.Name
Range("A2").Select

View 7 Replies View Related

Add Date To Filename

Jun 3, 2009

I picked up a bit of code to create a CSV with a | delimiter. so that I could save the file with a date added onto the filename. i.e. myfile060309.csv.

View 4 Replies View Related

Getting Date From Filename

Nov 13, 2013

I have filename as filenamex - filenamey-11-13-2013. I want to get only the date from the filename.

View 3 Replies View Related

Add The Date To A Filename

Aug 28, 2009

I need to add a date to the existing filename it is being saved as. Currenntly the filename is saved as follows:

x = Cells(Rows.Count, 1).End(xlUp).Row
For a = 2 To x
y = Cells(a, 12)
Workbooks.Add ("C:Documents and SettingsDesktopTemplate.xlsx")
ActiveWorkbook.SaveAs FileName:=y
Next a

I want the filename to stay the same as above but add "-r-"a number entered into a textbox representing the revision and then the date the file was saved in the following format dd/mm/yy.

The form containing the text box has been scripted and works fine. The string entered in the textbox currently resides in the Active sheet being saved in cell "E4".

Below is a completed Filename. Note the RED is what i need to add.

2138-035-PW-COM01-RCS-001-r-1-28/Aug/09

View 9 Replies View Related

Index With Multiple Criteria Including Date Range

Dec 2, 2013

I know need to modify the formula to include validating if the indexed reference occurs within a certain month.

{=INDEX('Duration Calculations'!B$2:B$5000,SMALL(IF(MONTH('Duration Calculations'!$J$2:$J$5000=10),IF(ISNUMBER(SEARCH("br",'Duration Calculations'!$A$2:$A$5000)),ROW('Duration Calculations'!$J$2:$J$5000)-ROW('Duration Calculations'!$J$2)+1)),ROWS(P$100:P101)))}

Essentially, what I am trying to do is index the value from B column if it meets the following criteria

1) Date in column J is equal to any date that occurs in October
2) the Column A has a text value equal to "br"

If both true then I need to index the value in column B.

The formula as states works finding any value equal to "br" but seems to be ignoring the date range.

View 1 Replies View Related

SUM (count) - Multiple Criteria Including Date Ranges

Oct 23, 2009

My setup is - excel 2003 sp3 / windows xp

On one sheet (Data) I have a list of action items, each with owner; target date; classification and in some cases revised target date. I'm trying to report on these fields and provide a status, by owner and classification, of how many are overdue; due this month; due next month; due beyond 2mths.

Using a SUM array formula on another sheet I can count the number that are overdue based on date; owner; classification; and target date, but can't find a solution if there is a revised target date. Any guidance you can give would be greatly received.

=SUM((Data!$L$3:$L$27=D$18)*(Data!$P$3:$P$27=$C23)*(Data!$N$3:$N$27

View 9 Replies View Related

Extract Date From Filename For New Tab

May 9, 2014

Every week we produce a report that has the filename: Master_BER_Pending Revokes Report_YYYY-MM-DD.xlsm

Some of the information from this workbook needs to be pasted into a new tab on a different workbook. The new tabs naming convention is simply "DD MM". Currently I've got a command prop that asks the user to enter it in manually. See below

VB:

Dim newsh As String
newsh = InputBox(Prompt:="Enter new tab name", Title:="Tab Name", Default:="e.g. '05 05'")
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Select
ActiveSheet.Name = newsh

The user gets the information for the month and day from the filename of the report that was produced. What I need is the DD and MM to be extracted from the filename and used to name the new sheet.

View 6 Replies View Related

Formula To Get The Date From Filename

Jun 25, 2009

I have a folder full of sales reports, all of the files are given a consistant format e.g. 09_wk50. I have a macro that do various calculations in each book. I now need a calculation based on the report date.

I am able to get the file name in the sheet so that I am just left with the value above (09_wk50) but I need to be able to get an actual date from that value.

I need to be able to get the monday of the week given. for the example given i would want the date 13/04/2009 because of week 50 in 2009, the 13th is the Monday.

View 4 Replies View Related

Date Appended To Filename

Oct 29, 2009

I searched this forum to find a macro that will do what I'm describing below. There seems to be quite a number of macros doing almost what i want, but most require a macro to be run, filename to be entered, etc...

I want the macro to automatically append the current date to the filename when it is saved. It must save it in the same directory where the file was opened from, and the name must be exactly the same as before, except that it must remove the previous date appended to the filename, if there was one appended.

I don't want to run the macro for this to happen, the normal File Save command must do the trick...

Thus c:my documentsTest.xls will become c:my documentsTest 29102009.xls; and
c:my documentsTest27102009.xls will become c:my documentsTest 29102009.xls

View 9 Replies View Related

Open File With Date In Filename

Aug 6, 2013

I have a csv file named "BB31_2013-08-01". I would like to open this file via vba and this is not my only file. I also have another similar fileames such as "BB31_2013-08-08", therefore, I try to create some function like yyyy, mm & dd where I can modifie it easily for next file.

Here is my code:

VB:
'change weekly
yyyy = "2013"
mm = "08"
dd = "01"

Workbooks.Open Filename:= _
"C:Documents and Settings1314228DesktopTest ProgressBB31& yyyy &-& mm &-& dd.csv"

[Code] .....

View 3 Replies View Related

Save Xls With Date Appended To End Of Filename

Dec 24, 2008

Below is a bit of a big macro i'm writing but I'm not sure how to edit my code to append the date after the filename. Then i'll need to refer to the exact filename later in the code?

View 2 Replies View Related

Creating A Log That Logs The Last User That Saved The Workbook Including The Date And Time

Mar 16, 2004

Is there any way of creating a log that logs the last user that saved the workbook including the date and time. I would like the log to be a sheet hidden in the workbook. Not many people will be saving the workbook.

View 9 Replies View Related

File Save As With Added Date To Filename?

Aug 9, 2012

I want to create a macro that when executed changes the name of "File1" to "File1 - Edited 8-9-2012". With the date being today's date (variable). This file is going to be emailed to someone who will then execute this macro.

Is there a way to prompt the Save As window with the updated file name so the user can save the file where ever he/she wants?

View 9 Replies View Related

How To Save With Automatic Filename Plus Today's Date

Jul 28, 2007

Is there a way to save a file and have it automatically put today's date in the file name?

Example: original File name = test.xls
desired file name = test072807.xls, or test.072807.xls, or test.07 28 07.xls

So, I open the file, do whatever, and then click save.
When I click save, it does one of the above, given that today is 7 28 07.

View 9 Replies View Related

Date Cells In Project Plan To Change Based On Other Cells Including Other Date Cells

Oct 31, 2008

This is a project plan with tasks and dates. Column A is the activity number. (Example 1, 2, 3" etc). Column B is the task (Ex. "Complete Report"). Column C is number of days required to complete the task. Column D is the dependency column. (Ex. Cell D2 =1 in other words Task 2 is dependent on task 1). Column E is the date.

I would like to have a seperate start date cell and a go live date cell.

The objective is to enter a start date, and have each column E date increase based on the number of days entered in Column C. If a task is dependent on another and I change the number of days in Column C I need the dependent task to change the same amount of days.

View 9 Replies View Related

VbA Code To Automatically Put Date Filename And Default Save Location

Aug 11, 2008

I have a spreadsheet that from a button I want to run a macro that will input todays date, the value in cell A1 as the filename into a default dialog box that is at a default file path. I have been trying to do this for several hours and can not completely get it done.

View 9 Replies View Related

Excel 2010 :: Macro To Open XLSM File Based On Latest Date Found In Filename

Feb 11, 2013

I'm on excel 2010 and I have a small group excel files I open everyday. Most of the files are static in name and location. I've got a macro created to open those files, which works fine with workbooks.open and the file path.

There are two report files I want to incorporate into my macro of workbooks to open. The files are created weekly and the files names have the following format: "Report Name (YYYY-MM-DD).xlsm". I don't want to use the file's last modified date because older files may get edited after the more recent ones are created. The files are also not always created on the same day, so the solution needs to be flexible enough to not refer to a specific day of the week or anything.

Macro open an excel file based on the latest date found in filename.

View 9 Replies View Related

Record Filename And Creation Date Of File Used In Another File

Mar 21, 2014

I have a template file that I import data in to, which is then saved with the current date. This works, but I want to automate the import of the data, but ensure I don't duplicate the load.
Therefore, I have a tab 'FileLog' that I record the filename (variable by date) in column A and Creation timestamp in column B.

How do I obtain the filename and creation timestamp of the import data so that they can be entered?

View 11 Replies View Related

Amending The Filename In Cell("filename")

Jul 7, 2006

I am trying to display the Filename in a cell on my worksheet. However, when I enter the =Cell("filename"), it provides the full path (C:/Documents......Cost Summary.xls) How can I display only the filename without the path?

View 3 Replies View Related

IF Statement Including BETWEEN

Mar 31, 2006

How can I write an IF statement that evaluates whether a cell's value is
BETWEEN two numbers?

Example:

A1 = 89.99

I need a statement that evaluates whether A1's contents are between 80.01
and 90.00.

View 14 Replies View Related

Including 0 In Formula (#DIV/0!)

Jan 31, 2010

I am trying to create a marksbook that will ignore blank cells and calculate a percentage based on the amount of tasks completed.

So far I have managed to get it all working EXCEPT if I enter 0 as a value.

For example, suppose there are two tasks, both of equal value. If a person was to get 100% for the first task, and 0 for the second task, you would expect the total to be 50%. I cannot get my formula to recognise that a 0 has been entered.

(Cells F5:T5 are what the task is out of. Cells F6:T6 is the weighting. I want to be able to enter a 0 in cells F8:T8 to include it in the final percentage.) ...

View 9 Replies View Related

Including Word ZERO In IF Statement

Feb 26, 2014

How do you go about entering the word "ZERO" in an IF statement? Every time i try to add it to my formula it turns it into the number 0 which is not what i want because i want to differentiate between the two??

View 1 Replies View Related

Subtotal Including First Row Of Next Group

Mar 9, 2014

I'm running the subtotal function, but for some reason Excel is including first row of next group in one of the groups. The label I am subtotalling on is the result of a formula, but why would that make a difference?

See row 11 and 12 in the attachment : subtotal problem.xlsm‎

View 2 Replies View Related

Functions Including Several Sheets

Aug 13, 2007

i can do the very very simple math formulae in excel, but now i have two excel files. Suppose the first excel file contains the numbers: x1 x2 x3, and that the second contains the numbers: y1 y2 y3.

i need to make a formula that includes x1 value and y1 value, then another one that includes x1 and y2, then x1 and y3, then x2 and y1... and so on.

View 13 Replies View Related

Averaging Numbers But Not Including Zero

Sep 11, 2009

I have a row of cells containing numbers, some of which are 0, how can i get an average where it averages all cells except the 0, as at the moment it is distorting my results.

View 3 Replies View Related

How Do I Get An Average Without Including The Zeros

Jan 27, 2006

I am using a formula to include all values greater than zero in my average which has worked fine until i tried to extend the parameters, then it gives me the Value? sign. Does anyone know another way to accomplish what i want?

here is what i am using now.
=average(if(BZ28:CM28<>0, BZ28:CM28, " "))

i was trying to make the CM extend to CS, but for some reason it is not working.

Anyway, i figure a different equation might be better than what i
have and solve my problem.

View 10 Replies View Related







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