[VBA] Day Of Week Filtering

Sep 16, 2007

I've been trying to write code to filter a list of date base on day of week (Mon, Tue, etc)

My problem is that i can't find a way to code the filter criteria... since the date does not contain any week of day constant. i don't want to create another column in my sheet to show the week of day constant and filter this instead.

Here's my not yet finished code...


Sub DayOfWeek()
Dim sAnswer As String
Dim bWkDay As Byte
Dim loMyData As Range
Dim iFilterCriteria As Integer
Dim Dateserial As Integer
Application.ScreenUpdating = False

sAnswer = InputBox("Please select day to display data (first 3 letter of the day, eg. mon)", Title:="Select day to display")

View 9 Replies


ADVERTISEMENT

Using Days Of Week As Criteria For Filtering?

Oct 20, 2013

Row H contains a date.

This date "example... 10/14/2013" Will always be a MONDAY

I am trying to figure out the code to filter out any Monday that is not of the current (changing) week.

View 5 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

Auto-updating Formula For Week Over Week Change?

Dec 11, 2013

I was wondering if there's a way to add a formula to calculate week over week % change automatically every week when I enter in new data. see the attached excel file for reference.

What I would like to have is the ability for the formulas in c5 and f5 to be able to auto-update to the newest week and the previous week's data instead of manually having to update it each week. So if I were to add a new row with data for week beginning 12/2, the formula in c5 and f5 would automatically update to calculate the week over week variance. I tried researching prior to asking the question on this forum, and I think it may be possible to do it using the index match function, but I'm not sure how to apply it in this case.

View 3 Replies View Related

Delete And Insert Record Week On Week

Aug 6, 2008

I have a comparison model that looks at two weeks of data. I am trying to get around the deletion and insertion of records week on week. With the code below, I can currently find and correct the deletions and insertions to the list, and then resort the list so that the comparison will work.

Sub CheckForNewProjsRemovedProjects()
Dim MyCell As Range, oCell As Range, NewCell As Range
Dim Rng1 As Range
Set Rng1 = Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
' Columns("B:B").Select
Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"C1"), Unique:=True
For Each oCell In Rng1
For Each MyCell In Range("C1:C" & Range("C" & Rows.Count).End(xlUp).Row)
If MyCell.Value = oCell.Value Then................

View 9 Replies View Related

Week Number Caluclating Hours For Week

Mar 6, 2010

I have a running time sheet daily. It has 2 columns for Labor and 2 columns for travel
i.e. travel From / To 1300-1400 calculate 1 hour then travel home 1600-1700 1 hour this is calculated by the date entry 01/02/10 I have another calculation that tracks by the date i.e. 01/02/10 then Next job which all works fine.

The problem becomes how do I calculate a weekly total labor and travel by the date So added another column called weekly hour’s labor and use the Weeknum to determine which week is which day/date so the first Monday in January 2010 is week 2

2 problems
Having many multiple day / date entries are the same date x 7 days Monday –Sunday
(Relies on the date entered and the weeknum) 01/03/10 each line is complete however the dates carry over as does the time

When trying to calculate each row x 3 same date time then the value will be incorrect I need to calculate
Say 9.5 hour labor from the date 01/03/10 not 28.5 hours and then calculate the total weekly hours
01/03/10, 9.5 hours labor, 3 hours travel
01/03/10, 9.5 hours labor, 3 hours travel
01/03/10, 9.5 hours labor, 3 hours travel

i do have work and travel times for each job on the same line (separate columns) but I display the total here by date to summarize the totals
i have tried sum products and sumif to avail. I am using Windows XP SP2 with MS Office 2007

how do i calculate weekly hours by date and weeknum ?

Total Work per day

Total Travel per day

Daily....................

View 9 Replies View Related

Formula To Tell When Its Week 1 Or Week 2 Of A Any Given Month

Jun 16, 2014

I'm trying to write a formula that will tell me when its week one or week two, week three and week 4 based on a given date of any month.

I'm using weekday formula but no luck.

View 6 Replies View Related

Comparing Files From Week To Week

Feb 5, 2009

I have to download a report every week and have been manually checking the report weekly for changes.

View 5 Replies View Related

Formatting Date: Add The Month And The Text "Week" Before The Week Number

Nov 24, 2009

I have a column where I am convering the Date into a Fiscal week number.

For example 10/6/2009 is Work week 41
Now I want to show October Week 41

I need to add the month and the text "Week" before the week number. what is the formula I use.

View 3 Replies View Related

Copy Week Total In Weekly Sales Worksheet To Appropriate Week In Monthly Sales

Oct 14, 2009

I need to copy the values of a range on the weekly sales worksheet to the monthly sales worksheet. The last column is the total on the weekly sales. Part of the heading of the total column is the week ending date (e.g. 10/17/2009. On the Monthly Sales I have the months in columns by week ending (e.g. 10/17/2009).

Range I4:I28 to the monthly sales worksheet by date.

View 10 Replies View Related

Convert Date To Year/week Of Year/day Of Week

Apr 6, 2007

Is it possible to format cells to convert a date format of month/day/year to = year/week #/day of week? For example, 04/05/07 (April 5, 2007) would read as 7145, (7=last digit of year/ 14 = week number / 5 = day of week....Sunday being the first day of week)

View 9 Replies View Related

Filtering More Than One Row Of Each Set?

Nov 10, 2009

I am having an issue filtering data in a spreadsheet:

Each set of information has 5 lines of information (title, information, manager, status, sponsor) and the first column of each data set is a merged 5 row box with the area of operation (this does not have to be merged if this is creating the issue). I need to be able to filter by area of operation and have all 5 rows showing. Right now, Excel only shows me one row for each set of data with the area of operation as one row.

View 2 Replies View Related

Filtering 2nd Row On Spreadsheet Instead Of 1st Row

Mar 11, 2014

I have a spreadsheet with Row 1 as the header and Row 2 as sub-headers. I want to filter automatically to 2nd row, but whenever I press on Ctrl+Shift+L, I have the first column filtered. I have another spreadsheet that whenever I press Ctrl+Shift+L, it automatically filters the 2nd row instead. I'm not pretty sure what's the difference. I have my spreadsheet frozen on cell B3 (not sure if it has something to do with freezing cells. I know I can select 2nd row before pressing on Ctrl+Shift+L, but is there some other way to have this automated?

View 2 Replies View Related

Filtering Dates With ><=

Feb 15, 2009

If I give excel the advanced filter criteria <=2/15/2008 it seems to list all the dates prior to and on that date. Are there any pitfalls to this filtering technique (i.e. would any dates fall through the cracks)?

View 2 Replies View Related

Percentage Of A Value After Filtering

Sep 17, 2009

I would like to know whether it's possible to evaluate the percentage of a text value ie 'Approved', after filters on other columns have been done.

AREA YR DECISION

HN 09 APPROVED
NYM 08 REFUSED
RC 09 APPROVED
HN 09
RC 08 REFUSED
? %

So if I filter by AREA and/or YR, I would like the % of how many were 'Approved' in that filtered range (ignoring any blank cells in the DECISION column).

So far I have a basic
=TEXT(COUNTIF(C2:C6,"*Approved*")/ROWS(C2:C6),"0% ""Approval Rate""")
but it doesn't work once I filter by AREA or YR, and doesn't ignore blanks.

View 5 Replies View Related

Keyword Filtering

Nov 14, 2008

I'm quite newbie for VBA for excel, my friend asked me a favor to filter the data on his excel, so when he enter some keyword, the table would sorted (only show the row that have that keyword), and if possible that he enter it few keyword.

keyword example VB, oracle

table example ....

View 10 Replies View Related

Filtering Columns

May 13, 2009

I have an excel with the following information

A1 - Is a dropdown which will have names of the systems (EAI,Mediation,CDF
..,All)

Row2 will be header which will have following data

B2 - Project Id
C2 - System ID
D2 - Project name
E2 - Project Phase
F2 - Status
from g2 to GN2 there are about 60 resources names entered

From C3 to F3 the data wil be entered and appropriately a chk mark will be
made to the corresponding resource wroking on that project

Say i have about 10 systems provided as dropdown for entering data in A1
(Ex: EAI, MEdiation, .....)
There are resources working for each system

when i apply filtering on a system name i shoud be able
to show only those resources working for that system and all others should be
hidden

Also under the "system" dropdown i will have an option "All", when "All"
option is selected i should be able to see all the data for all the systems.

EX: if i take system "EAI" and if the resources working for eai are there in
AO2 to AX2 then i want the resources from AX2 onwards and before AO2
not to be shown.

If i take a system "Mediation" and if its resources are from Z2 to AI2
then i want resources before Z2 and after AI2 notto be shown.

If "All" option is chosen then i should be able to see the whole sheet
with all the data for all the systems and all resources.

View 12 Replies View Related

Filtering In 2003..?

Oct 9, 2009

I have a filter that works in Excel 2007, and I'm trying to figureout how to make it work in Excel 2003. OrderNums is an array of multiple criteria. The below code works perfectly in Excel 2007.

View 3 Replies View Related

Filtering Before The Pivot?

Nov 3, 2011

I've filtered my data - such as selecting a date range - and then run the pivot, but the pivot ignores the filter and gives me data for all the dates. my workaround is to copy and paste the filtered data to a new sheet and run the pivot off that sheet. This works fine, but maybe I can avoid this step?

View 1 Replies View Related

Filtering Tables With VBA

Dec 11, 2013

I have a worksheet with data in named tables on several sheets. Each of these tables has a column called "filter" (this is not always the same column number between sheets). The values in this column are either 0 or 1, depending on if that particular row is relevant under the book's current selections.

I'm trying to figure out the code that will take a table and filter it to show only the rows which have a 1 under the "filter" column.

View 2 Replies View Related

VBA Code For Filtering?

Jan 31, 2014

I have added below code in module to get list of parts which are not delievered.

I am trying get code which will end the macro as soon as its do not find mentioned crieteria i.e.

("Not Delievered")
Selection.AutoFilter
ActiveSheet.Range("$B$1:$B$5").AutoFilter Field:=1, Criteria1:="Not Delievered"

View 1 Replies View Related

How To Use Sumif With Filtering

Apr 14, 2014

I have a sumif function in a cell which adds values from a table from another sheet. When I apply a filter in the table, the sumif still includes the invisible rows. Is there a simple way to add only the visible rows with a function based on a criteria like with the sumif. i.e. after certain rows are not visible, still a further slection has to be made base don another cell in the same row.

View 2 Replies View Related

Filtering Out Numbers

Jan 22, 2007

I have a worksheet with about 1000 entries and I have this is column F so it can sort out all Euston entries into 1 block. =IF(E1="EUSTON",0,1) What I need to do also if it is possible all entries in column B end in even no's it sorts it out into the block that Euston is in and if their odd no's they go into the other block. Dont know if I can add to this or need something else.

View 9 Replies View Related

Filtering From A List

Feb 2, 2007

to dynamically filter a list as shown below

View 9 Replies View Related

Filtering Addresses

Feb 26, 2007

I have a list of addresses (including street numbers and names), but want to select out addresses that match another list of street names only. I have only used vlookup before, but because one list included street numbers as well, I can't find exact matches.

I am using excell 2007.

View 9 Replies View Related

Filtering Dates

May 30, 2007

I have a three columns of data in A,B,& C.

In column A a From Date
In column B a To Date
In column C a 6 digit number

I would like some code to achieve the following in this order:

1) Find any duplicates of the 6 digit number in column C and then place them on the same row as the first.

I.E if the following three matches are somewhere in columns A, B and C:

A B C
08/07/2007 22/12/2007 731655
22/12/2007 29/12/2007 731655
29/12/2007 05/07/2008 731655

I want them to place on the same line in date order like:

08/07/2007 22/12/2007 731655 22/12/200729/12/2007 731655 29/12/2007 05/07/2008 731655 (this line would be on the line above)

2)After all the above has been done I would like the code to go through and looking for matches of dates between column B and A

For example if I had the below two dates somewhere in the list:

A B C
08/07/2007 04/08/2007 729955
04/08/2007 01/09/2007 729293

I would want the bottom one to be moved to the same line as the top like:

A B C D E F
08/07/2007 04/08/2007 729955 04/08/2007 01/09/2007 729293

If there are more than one match like below:

A B C
08/07/2007 04/08/2007 729955
04/08/2007 01/09/2007 729293
04/08/2007 01/10/2007 729273

I would like the following:

A B C D E F
08/07/2007 04/08/2007 729955 04/08/2007 01/09/2007 729293
04/08/2007 01/10/2007 729273

3) AFter this was completed I would like to look for date matches one day apart for example:

A B C
08/07/2007 04/08/2007 759955
05/08/2007 01/09/2007 759293

And then place the bottom set of date along side the top like:

A B C D E F
08/07/2007 04/08/2007 759955 05/08/2007 01/09/2007 759293

View 9 Replies View Related

Sorting And Filtering ..

Nov 29, 2007

in the table i have

A1-apples
A2-bananas
A3-eggs
A4-balls
A5-bananas
A6-apples
A7-apples

I need one list that will show me all items that are on list so i would get:

A50-apples
a51-bananas
a52-eggs
a53-balls

to simpilfy this list would show me what types are there in the first list

View 9 Replies View Related

Filtering The Due Dates

May 12, 2008

I have a simple excel sheet and two of the columns show a Due Date and a Received Date. All I want to do is highlight any cell in the Received Date column where the Received Date is greater than the Due Date. The spreadsheet shows Purchase Orders and shows when they were due to be received and when they actually were received. i'd like to be able to show all orders that were received past their due date.

View 9 Replies View Related

Filtering Data

Aug 4, 2008

I hav a 2 columns. Column A contains data for 2 engineers, "paul" and "john".
Column B contains the hours they work each day for a month.

i would like to filter "johns" results and find out how many hours he works in total. i do not wish to use the autofilter, is there an easier or quicker way of filtering it???

john 11:03:08paul12:04:09john 15:11:44paul18:09:00john 05:34:24

View 9 Replies View Related

Proper Filtering

Jun 4, 2009

Is there a way to filter my data with the combobox and have the listbox reference the filtered data directly?

I am populating a listbox from a rowsource, housed in a sheet in my workbook, the sheet in my workbook is populated from another sheet that is filtered by a combobox selection and pasted to the sheet with the rowsource range.

My listbox is a multiselect with 5 colums and columnheads, named ListBox42

The sheet with the data to be filtered is named Building Material

Building Material is filtered in column “M” with a color

With ComboBox24 selected name: Names “M1” which activates the color down the column for filtering.

The ComboBox24
Private Sub ComboBox24_Change()

Worksheets("BuildingMaterial").Range("M1").Value = ComboBox24.Value
Sheets("BuildingMaterial").Select
ActiveSheet.Range("$M$1:$M$4247").AutoFilter Field:=1, Criteria1:=RGB(0, _
176, 240), Operator:=xlFilterCellColor
Sheets("matfilter").Cells.ClearContents
Sheets("BuildingMaterial").Select
Range("B1:F4249").Copy
Sheets("matfilter").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("BuildingMaterial").Select
ActiveSheet.Range("$M$1:$M$4247").AutoFilter Field:=1
Application.CutCopyMode = False
Sheets("matfilter").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Tom").Select

End Sub

My RowSource is a defined name “=matfilter!$A$2:$E$4230 “

View 9 Replies View Related







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