Create Macro That Filter Date In A Column From One Week Previous Till Current Date

Mar 14, 2014

I have an excel sheet wherin there is a column that has the data where in the dates are displayed and many other columns.

I get this excel every Thursday so i want to filter this date column in such a way that it give me the data related to the date of the previous week only yet there is a catch here. When i say previous week i mean.

Suppose today is 03/14/14 then i want the data from 03/07/14 till today ie Last week friday to this week full( so cant use Current week option) and then paste it in a new sheet.

I tried the Record part but in that it is taking a hard coded value as i am selecting the date myself. I dont want to change the date manually every time.

this was the macro that was created

Code:
ActiveSheet.Range("$A$1:$BX$58").AutoFilter Field:=1, Operator:= _
xlFilterValues, Criteria2:=Array(1, "3/10/2014")
Range("A59").Select
ActiveCell.FormulaR1C1 = "=COUNT(R[-4]C:R[-1]C)"
Range("A60").Select

View 8 Replies


ADVERTISEMENT

Excel 2003 :: Week To Date Running Hours Worked Totals - From Thursday Till Wednesday?

Jun 12, 2014

I have two columns with total hours worked at different places and a grand total for both together in a third column.

I'm trying to sum the total hours for the week so far from Thursday till the following Wednesday for each week.

I want the wookbook to look up todays date and tell me what the total hours are for the current week

I'm using Excel 2003 - see the file attached

View 14 Replies View Related

Macro To Create Fiscal Week To Month And Date

Dec 2, 2012

I have to generate daily report in which data is fiscal week format. We need to show Fiscal week in actual month and day format. create a macro so that for every fiscal week anywhere in the sheet, it automatically converts fiscal week to month and days of the week

For example: WK 1 OCT FY2013 get converted to Oct 1-7

WK 2 OCT FY2013 coverted to Oct 8 - 14

WK 3 OCT FY2013 get converted to Oct 15 -21

WK 4 OCT FY2013 to Oct 22-28

WK 5 OCT FY2013 to Oct 29- Nov4

View 4 Replies View Related

Previous Date To Most Current Date

May 9, 2013

I have a column with a few dates.

I need a formula to display the previous date to the most current date out of the list.

How do I do that?

View 5 Replies View Related

Find Date Of Weekday In Previous Week.

Sep 27, 2009

I've been racking my head on this one.

I need a function where for a given date will return the date of a specified weekday in the previous week.

Example: If today is Friday Sept. 25th 2009 and I want to find the date of
the Wednesday in the previous week I would need something
like DATEPREVIOUSWEEK("09/25/2009", vbWednesday)

View 9 Replies View Related

Current Week Beginning And End Date

Apr 20, 2009

Is there a snatch of macro that can assign two variables with the date for the beginning and ending date of the current week?

I need
A= 4-19-2009 12:00AM
and
B=4-25-2009 11:59 PM

Based on the current week being week 16, with the variables changing as the weeks progress.

View 9 Replies View Related

Formula To Obtain Current Week Monday Date

Mar 17, 2013

The portfolio team uses data that is refreshed every Monday. Write a formula to obtain the current week's Monday's date.

View 3 Replies View Related

How To Insert Date Range Automatically Which Is Referring Current Week

Mar 6, 2014

i got a problem with date range.actually i wanna to insert date range automatically which is referring current week.

View 2 Replies View Related

Auto Open Macro To Find Correct Week Tab & Day/date In 52 Week Worksheets

Jan 19, 2010

I am new to VBA & not sure of the full understanding of code copied from a workbook which worked on the same principle but with Monthly (12) tabs. I thought if modified to show weeks, the macro would be able to locate the current week tab & day/date within - but upon opening, the cell stops at WK19 & column O - rather than WK43, Column N (which changes daily).

Sub Auto_Open()
week(1) = "WK1"
week(2) = "WK2"
week(3) = "WK3"
week(4) = "WK4"
week(5) = "WK5"
week(6) = "WK6"
week(7) = "WK7"
week(8) = "WK8"
week(9) = "WK9"
week(10) = "WK10"
week(11) = "WK11"
week(12) = "WK12"
week(13) = "WK13"
week(14) = "WK14"
week(15) = "WK15"
week(16) = "WK16"
week(17) = "WK17"
week(18) = "WK18"
week(19) = "WK19"
week(20) = "WK20"
week(21) = "WK21"
week(22) = "WK22"
week(23) = "WK23"
week(24) = "WK24"......................................

View 9 Replies View Related

Calculate Next Due Date Based On Start Date Frequency And Current Date?

Mar 9, 2014

I'm trying to workout how to take a known initial date a repeating frequency and work out the next due date from today.

Example

Initial Date :- 1st of January 2014

Frequency :- every 5 weeks

Current Date :- 9th of March 2014

Next Due date should be :-12th of March 2014 (if I worked it out correctly from my paper calendar)

I want to use a cell formula to do this for different initial dates and varying frequency periods (the frequency will always be whole weeks i.e. 1,2,3,4,5,6,7,8,8,10)

View 4 Replies View Related

If Cell Is Empty Create Rule To Display The Current Date

Sep 5, 2007

Im trying to find a formula that when a cell is empty ie this cell is linked to another cell on another worksheet and info has not been entered or is 0 then i want the cell to display the the current date ie =NOW()

View 10 Replies View Related

Create Workbooks From Sheets & Append Current Date To Saved Names

Apr 22, 2008

I have a workbook with multiple worksheets. First 4 tabs are the standard tabs and rest of the tabs are created based ona macro with the unique names. Now i want to create the separate workbook for each tab by its name and , date and time stamp in a C directory.

View 5 Replies View Related

Macro To Delete Previous Date

Jun 23, 2007

I need a macro to loop through a column and delete any date prior to todays date, as well as all cells in the deleted date's row.

View 2 Replies View Related

Macro: Return Previous Working Days Date

Dec 1, 2006

how do i get the previous days working date in VBA, how can i get VBA to determine wether we are in the week, and how will i get it to know its a monday to retrieve fridays date?

View 3 Replies View Related

Count Date Cells Where Date Is Previous Month

Oct 25, 2006

I have a spreadsheet which I use to track when a work request is recieved, when we confirm the request and when we action the request. I have been trying to write some code to count the amount of requests, receipts and actions we have processed in the last month.

My first column shows who the request is from
The second shows date recieved
The third shows date we send receipt
The fourth shows the date actioned.

View 9 Replies View Related

Show Week Number Of Today Date From Starting Date

Jun 27, 2014

is it possible to display the week number of todays date (today()) from a physically entered start date (which would obviously be week one), the start date would be november 4th 2013.

View 3 Replies View Related

Disable Macro After Saving With The Week Start Date

Apr 21, 2007

I am trying to code a macro call where in once the file is saved with the current week start date all the other macro's should be disabled. Since am having lot of data and report sheets which needs to be added and deleted in the run. It causes me problem when I try to open it again to view the results. For example I have a sheet named apple and another one applereport. I have made my code to delete apple since it is a data sheet. I want apple report to have all the other macros disabled once its been renamed to week start date for now it is 16 Mon 2007.

View 3 Replies View Related

Find Pay Date From Date Sold (Friday Of Following Week)

Feb 17, 2014

If a sale was made between 2/09/2014 - 2/15/2014 return the date of the following weeks Friday. In this case 02/21/2014.

View 3 Replies View Related

Week Number For Date Relative To Date Range

Mar 17, 2008

Is there a UDF that can determine the number of weeks for a date range specific that is not relative to the week number for the year but for the date range itself. i am aware of the weeknum function but this is for week number relative to the year. eg. date range 01/03/2008 - 31/05/2008 has approx 12 weeks and 14/05/2008 will be week number 10 for the range.

View 4 Replies View Related

Automatically Populate Column With The Most Current Date

Oct 11, 2009

I want to automatically populate C2 with the most current date from B9:B14.

I can't seem to figure out the formula.

View 3 Replies View Related

Adding Current Date Column Using Excel VBA

Nov 8, 2013

How to add current date till the end of the column until data exists.

i used

With Range("A2")
.Value = Date
.NumberFormat = "mm/dd/yy"

A1 will have the heading and from A2 till data exists it should show the current date .i used above code it gives date in A2 but doesn't copy to the remaining rows.

View 5 Replies View Related

Enter Current Date Into Last Used Row Of Column Of Another Sheet

Mar 1, 2008

From sheet1 on a checkbox click I am attempting to post the system date into sheet3 cell c3. If c3 already contains data then I want the cell selection to go down to the next row and post the date there. I if cell c3 has no data then it posts fine but if I need to goto the next row then I get a runtime error "object doesn't support this property or method".

If Me.GCN = True Then
If Not IsEmpty(Worksheets("GCN_Paid").Range("c3")) Then
Sheets(3).ActiveCell.Offset(1, 0).Select
Sheets(3).Range("c3") = Date
Else
Sheets(3).Range("c3") = Date
End If
End If

View 3 Replies View Related

Find Current Date Heading Column

May 16, 2008

I have created a simple command button for tallying that will increase the count in the output cell by one every time it is clicked. It has basic code like this:

Private Sub ProductRegistration_Click()
[D4] = [D4] + 1
End Sub

On top of that, I want the output cell of this command button to switch every day. In this case, it would move to E4 tomorrow. The columns are dated but I can't figure out how to get the output cell to automatically change with the system date so I don't have to manually change it every day.

View 3 Replies View Related

Check Whether Date Is A Month After Previous Date?

Dec 12, 2013

I'm sent a file every day where column A contains a month & year but in "general" format.

For example;

Column A, starting with cell A1 with the next date in A2, etc
Jan15
Feb15
Mar15
Apr15

Is there a way through a formula or macro that I can use in order to run through all the dates in this column to make sure that the next cell down is always the month after the cell above it? The dates go all the way through to 2018 in the above format.

View 3 Replies View Related

Finding The Date Of Previous Monday Of Certain Date..

May 4, 2009

I need a VBA code which tells me the date of previous monday of any date. The user types in any date to the cell A1, and I need the date of previous monday to be inserted to the cell A2.

For example:
A1: 9/5/2009 --> A2: 4/5/2009
A1: 19/5/2009 --> A2: 18/5/2009
A1: 27/12/2009 --> A2: 21/12/2009

View 4 Replies View Related

Macro To Insert Current Date

Jun 6, 2014

I'm working on a macro code that would create a Purchase Order number based on that day's date. So it's pretty simple since all you need to do is have a macro insert the formula:

[Code] .......

However, i don't want in the PO number any "/" or "-", is there a way to omit these? And is it possible to also make the current year in two digits and not four?

So if the PO number were to be today's date then it would look like this "6614".

View 4 Replies View Related

Have Macro Give Current Date

Jan 8, 2008

I'm having trouble with setting a date stamp with one. I'm creating a database in which a macro will take data from a table and compile it into a list. The first column of the compiled list should have the date the data was added (static - it shouldn't update afterwards). This is because the list will be added onto multiple times.

I found a site that sounds like what I need: ...

View 9 Replies View Related

Add Current Date When Running Macro

Nov 7, 2006

I have a macro that imports a report. In the header I'd like to display which day I imported the report, so I know I'm not looking at old data. I know I can use =TODAY() manually but I'd like to include it automatically in my macro.

View 7 Replies View Related

Determine Current Date In Macro

Nov 7, 2006

I'm trying to write a batch file that connects to a database and passes in an SQL query. One of the conditions of this query is the date. I need the batch file to figure out what todays date is and pass that in.

This is what I currently have.

ws_tran_date between to_date( '&datefrom 08:30:00AM', 'DD-MON-YYYY HH:MI:SS AM') and TO_DATE('&dateto 08:30:00am', 'DD-MON-YYYY HH:MI:SS AM')

When I run the batch file, it asks me to input the dates manaully in the format DD-MON-YYYY (eg 7-NOV-2006). I need the batch file to figure this out on it's own.

Is there some function I can call to do this?

View 5 Replies View Related

Excel 2010 :: Userform Date Picker Textbox Will Not Select Current Date

Feb 10, 2012

I have userform with date pickers and have text boxes overlaid on these, when I select todays date from the date picker it does not display the current date in the text box (I have 8 date pickers on the userform). If I select another date then reselect the current date it works. It has occasionally worked but why.

Below is the code for populating the text box from the Date Picker.

Private Sub DTPicker1_Change()
TextBox1.Value = DTPicker1.Value
End Sub

The initialize userform code uses the following to format and set the textbox

Code:

TextBox1.Value = Format(Date, "dd-mmm-yy")
TextBox1.Value = ""

Windows 7 with Excel 2010

View 7 Replies View Related







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