Can You Use VBA Coding To Sort By More Then 3 Criteria

Nov 28, 2006

I was wondering if there is a workaround for sorting in Excel by MORE THEN 3 CRITERIA?

I have seen a couple of solution doing 2 seperate sorts but was wondering if you can write code to expand on Excels limited sorting capabilities?

View 9 Replies


ADVERTISEMENT

Coding To Select Data Criteria Wise

Jul 29, 2013

I need to filter data on criteria wise and to move on specific sheets accordingly.

Example: sheet 1 contains all the details such as starting with AAA - 10 rows, BBB - 12 rows, CCC- 15ROWS ,DDD-13 ROWS etc in column 1.

I have created separate sheets for AAA, BBB, CCC etc

now I need all the details of AAA (in sheet1) to be moved to specific sheet AAA which i have created and so on.

I tried the below coding but there are few dependencies found.

Selection.Insert Shift:=xlDown
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="AAA"
ActiveWindow.SmallScroll Down:=-6
Rows("169:184").Select
Selection.Copy
Sheets("AAA").Select
ActiveSheet.Paste

View 2 Replies View Related

Macro Coding: Add A Code To The Sort And Paste Macro That Will Open The Second Spread Sheet

Jul 21, 2007

I am making a spreadsheet that sorts and pastes, but I need to know if I can add a code to the Sort and Paste Macro that will open the second spread sheet needed without just already having it open and using the

Windows("estimate sheet one.xls").Activate

View 2 Replies View Related

Sort - Defined Sort Criteria

Sep 20, 2006

I have an Overview sheet within my workbook that contains info from all other sheets.

What I want to do is when you click on the Sort button in the General sheet it will activate the Overview Sheet and

- first off sort all sheets starting with AJ together, then all sheets starting with CJ together and then all sheets starting with PJ

- then the next thing i want it to do is sort all Ajs by their start dates, sort all CJs by their start dates and the same for all PJs.

Now up until now I was keeping all sheets that began with AJs together in the workbook and so on so I was able to use the following sort function

Sub Overview_sorting() ...

View 5 Replies View Related

Sort Based On Different Criteria

Jul 23, 2014

I have a list of people that I want to sort according to their age in ascending order. If several people have the same last name (family members), I want those to be sorted together. After clicking on the SORT-button the result should look like this:

[Code] ...

Attached File : Test2.xlsm‎

View 13 Replies View Related

Sort Data Using Two Criteria?

Feb 17, 2010

I have multiple employees working on different projects. I would like to use a formula or some kind of macro where I can automatically scan an entire worksheet and manipulate the data to show me how much time was spent by each employee on each project. Using the SUMIF command only lets me use one criteria. In my case I need to sum if in the row there is a match with the employee name and the project name.

For example, if Employee A is working on Project 1 then sum the units. I would like everything summarized in a nice table. Attached is a basic example of my sheet.

View 3 Replies View Related

How To Sort List To COUNTIF Criteria

Apr 16, 2013

I have a list of 562 records. In order to generate a targeted mailing list, I would like to display) only those records meeting the criteria:

=SUMPRODUCT(--(M2:M562>0),--(U2:U562>0)) .

View 9 Replies View Related

Sort Array Based On Criteria From Drop-down

May 18, 2009

How can I sort an array of data based on the selection from a drop-down menu? And can it be 'secondary' sorted with the result from a second drop-down (ascending or descending is unimportant)?

View 2 Replies View Related

Sort Ascending/Descending Based On Criteria

Aug 2, 2006

I have an Overview worksheet that is pulling info from all other sheets in the workbook.

What I want to do is order that info in ascending order depending on the worksheet name.

So I want all the worksheet names that start with 'AB' say sorted in ascending order and all worksheets that start with 'BC' in ascending order.

Now this I have at present working by a macro I created which once the info is loaded onto the sheet I just selected the info and ordered it in ascending order. The thing is though the next time I enter this Overview sheet I might have an extra worksheet that starts with 'AB' and this will not be included in the order, I will have to adjust it everytime so I need a more automatic ordering process.

View 9 Replies View Related

Multiple Criteria Sort (Parsed From String) Macro

Aug 18, 2014

Have a sheet with list of strings in C:C

Examples of string:

RIO AU 082814 45
RIOE AU 102815 45.01

etc...these are the two primary types

Wish to reorder row 6 onwards according to the following hierarchy:

1st order: year number ascending (ie the last 2 digits of the 6 digit mid: 14, 15 in our example)
2nd order: month number ascending (ie the first 2 digits of the 6 digit mid: 08, 10 in our example)
3rd order: strike value ascending (ie the number on far right: 45, 45.01 in our example)

sortMacro.xlsx

View 3 Replies View Related

Excel Sort / Filter Function Based On Set Criteria?

Sep 9, 2012

I have following data to sort/filter

Sector
Flt no
origin

[Code]...

Is this possible with excel functions?

View 1 Replies View Related

VBA - Sort Using Two Sets Of Criteria And Find Closest 4 Numbers?

May 1, 2013

I have two sets of data:

Data set #1

Indicator PriceIndicator Price Date
2.1 10/27/08
2.11 10/22/08
2.17 11/21/08
2.38 03/20/09
2.38 03/25/09
2.46 03/19/09
2.5 03/09/09
2.5 03/24/09
2.53 12/04/08
2.73 12/09/08
2.82 12/24/08
2.83 12/18/08
2.89 12/12/08
2.9 03/13/09

Data set #2:

Close Price Close Price Date s1s2s3s4r1r2r3r4
2.25 12/11/09
2.30 12/12/09
2.40 12/13/09
2.00 12/14/09
2.12 12/15/09
2.50 12/16/09
2.51 12/17/09
2.53 12/18/09
2.49 12/19/09

What I'm attempting to do is find what are the CLOSEST four indicator prices in data set #1 are above (r1, r2, r3, r4) and below (s1, s2, s3, s4) the closing price in data set #2. Also, I can only use the indicator numbers in data set #1 that are on or before the close price date in data set #2. Because of this, not all of the r's and s's will be filled in.

I would like to use just regular excel formulas, but I have a feeling that VBA may be my only option.

View 3 Replies View Related

Filter & Sort Multiple Columns With Single Criteria

Sep 27, 2008

I have a spreadsheet with multiple columns. The first column defines a "route", and the next two list "start" and "end" cities for that route. The fourth column lists the length of each route. There are only a limited number of cities, so the same entries appear in both "start" and "end" several times. I would like to use Autofilter to sort the list for every appearance of a given entry in either "start" or "end". Is there a way to make Autofilter sort mutiple columns simultaneously?

I could achieve the desired end result with Advanced Filter, but I want something with the ease-of-use and immediate update/response of Autofilter. Advanced Filter requires explanation (as well as lots of clicking and typing) whereas Autofilter is self-evident. I also want to avoid VBA Macros as they are not well-understood by the users who will use this spreadsheet (and any VBA Macro will require very specific input to work properly.) Is it possible to do what I want? Or is Advanced Filter / VBA the only way to do it?

View 2 Replies View Related

Copy Rows Based On Criteria, Paste As Values To New Sheet & Sort

Apr 15, 2008

I have spent a few days searching through forums but cannot find examples that i have been able to successfully adapt ( because they are to complicated for my limited knowledge). I have a workbook with 5 sheets, sheet1 (current), and sheet 4 (archive) are the important ones. I need a macro to

A) copy rows from "current" to "archive" ( to the 1st empty row) if column S of "current" contains "Closed" ( the word is generated by formula).

B) The paste needs to paste special values and number formats ( want to lose formula but not conditional formatting).

C) data sort "archives" based on col A - this puts the newly archived data into correct sequence.Data sort lowest number 1st

D) delete the copied rows from "current".

e) give me a count of how many rows it deleted, (I have a macro to insert rows so will run that manually to recreate the correct number of emtpy rows (with formula and formatting) to bring the current sheet back to usual size.

I tried modifying a macro by RPaulson (based on cells on one sheet to cells on another), to work with entire rows but couldn't get it to work.

Found that paste special uses PasteSpecial xlPasteValues, but , and thats about it.

View 6 Replies View Related

Expand Table To Include Missing Times From Data And Sort Based On Multiple Criteria

May 6, 2014

I have a set of data (assume 2 columns, one with a long name and the second with a time). The names contain variables that must be used as criteria (a single entry may contain "Blue" and "On"/"Off") and times vary, based on when the Name turns "On" or "Off" [in minutes: 25 (On), 47 (Off), 89 (On), 100 (Off) and 137 (On)]. I need to create another table that automatically inserts values for all times, to include the missing times (0 min thru 24 and 26 thru 46, etc.). EX: If the first entry is "Blue-On" at "25 minutes", the cells from 0 minutes to 24 minutes are each "0" and become a "1" at 25 minutes - the following cells are "1" until 47 minutes (where it is turned off). (1 and 0 represent "On" and "Off", respectively)

How can I created a formula to insert the correct numbers into the correct places? I'm willing to have multiple cells with formulas and simply hide the columns that are doing the calculations.

View 1 Replies View Related

VBA Coding

Mar 18, 2008

I am trying to code a macro to run down through a column and hide the row if it finds a cetain marker (i.e. the letter "n") in the column, and then move onto the next one.

View 9 Replies View Related

Coding Months

May 22, 2007

My spreadsheet calculates the date on a daily basis.

I would like to create a code in my spreadsheet which uses the year and month in question.

First, 2006 is is designated as a "3"
2007 "4"
2008 "5"
2009 "6" etc

Don't worry about anything prior to 2006.

Next, the months are represented by single digits. So, January = 1, February = 2, March = 3, April =4, etc. September is 9, and October = 10 but all the numbers over 9 have to be reduced to a single digit, so October = 1+0=1, November =1+1= 2, December =1+2= 3.

Now, the formula for the Month is:

Year + current Month

So, May 2007 = 4 + 5 = 9
June 2007 = 4 + 6 = 10 = 1
July 2007 = 4 + 7 = 11 = 2,
January 2008 = 5 + 1 = 6, etc

View 9 Replies View Related

Coding A Macro In VBA

Apr 3, 2008

Is there a way of coding a macro in VBA that allows you, with one macro, to enter text in one cell and at the same time enter a value to the cell on it's right?

I don't want to name the cells, but I wondered if you could add to the code a piece of code that basically said "Select the cell to this cell's right and add the value x".

View 9 Replies View Related

Optimizing Coding

Jun 3, 2008

I have made this vba to go out and look at 2 different locations which contain simular folder names.

The script then writes the folder names in Column A, followed by the Size of both the folders from the 2 locations. The script is comparing the second location folder name to what the first process put in Column A so the folder names will be aligned with the file sizes. It is also converting the file sizes from bytes to the most appropriate one.

The problem I am having here, is once I put the second part in for the second folder, the script is either taking forver (More than an hour) or is freezing. So I am not sure if I put it in a loop somewhere or what exactly is happening. I am just wondering if I can get some help troubleshooting and optimizing this code....

View 9 Replies View Related

Lock Vba Coding

May 1, 2007

How it is possible to lock the VBA coding and Modules? I mean when Some one want to view VBA coding the Password window should not appear, istead of that a message box appears with message something like "Not viewable"

View 9 Replies View Related

Dropdown Box Coding To Another Cell

Dec 24, 2012

I have a drop down box with the 10 different shifts we run here at my work. Ie - Daytime (0700-1500), Nightime (1500-2300) etc. I have these on a drop box as stated earlier (Cell 6) - and want to code a selection from within the box, to effect Cell 7 with the approriate hours worked depending on what I selected in Cell 6.

View 2 Replies View Related

Coding To Order Stock

May 8, 2014

I am looking to create coding that once stock gets to a particular level a text box pops up to alert the user that more stock needs to be ordered and ideally I would like once the user selects ok for it to take them directly to the appropriate email template.

However, I don't want the text box to come up while we are waiting on the stock to be ordered.

i.e our current minimum stock level before placing our next order is 10,000 units. Order is placed and can be received within 10 - 14 days. During this time our 10,000 units will be used but I don't want an alert to pop up to remind the user to place an order as this action will already have been carried out.

View 1 Replies View Related

Dynamic Range In Vba Coding

Nov 2, 2008

I'm trying to write a code which would place formulas in the row just below the my range (normally a matrix of figures) to sum the column in that just above that. Here's what I've got so far but it doesn't work.

View 6 Replies View Related

Coding Multiple Cases In VBA

Mar 24, 2009

I am writing VBA code to do the following:
IF A1 > 50 then print array C1:E7

I have this code and it works.

View 14 Replies View Related

Deactivate Coding Not Working?

Sep 3, 2009

I have placed the following code in my spreadsheet but it's not working!

the code after option explicit (now at the bottom) works, (thanks to Andy on here!) but all the disabling the right click and cut/copy/paste etc doesn't.

View 6 Replies View Related

Coding For Changing Worksheet Name

Oct 26, 2009

when the accounts exported to excel, all the tabs shown in the file are generated. However, i need to change tab '3' to tab '10' name to the name stated in tab 'menu'. eg tab 1 need to be renamed as 'BB' (not BB/Bunut), tab 2 to 'GEN' (not GEN/General), etc. All must be capital letter.

View 5 Replies View Related

Using Index And Match In VBA Coding

Jun 3, 2014

I have table where i have to find a value based on 2 criterias. So i have used in Excel the below formula:

=INDEX($A$1:$D$7,MATCH(1,($A$1:$A$7=$F2)*($B$1:$B$7

View 1 Replies View Related

Color Coding Formula

May 14, 2007

i'm trying to figure out a formula that if a cell is greater or equal to another cell - color a cell "GREEn"

otherwise...color the cell "red"

View 9 Replies View Related

Macro - Color Coding

Jun 13, 2007

I am trying to figure out how to run a macro for 1 particular workbook in an excel spreadsheet. I don't want it run on any of the other workbooks in that file, just the 1. I can't use conditional formatting because I need more than 3 values (if statements).

This is what one example of data in a cell and below is the color I'd like it to turn when I run the macro:

T: 6/1/07
A: 6/8/07

Anything that has a A: (which means an actual date it happened) I'd like the cell to turn blue. If there is an RT: (which means revised target) I'd like the cell to turn red which means it missed it's target date, and has been revised. If it has a TBD I'd like the cell to turn pink (or yellow or any color really). All other cells are just white. I don't know where to find the color codes in excel as well. Other samples of what cells look like are below.

Here is another example:

T: TBD

And final example:

T: 6/4/07
RT: 6/15/07

View 9 Replies View Related

Vba Coding For A Simple Clock

Sep 15, 2008

where can I get vba coding for a simple clock.

I would like the clock to be digital rather than analogue if possible

View 9 Replies View Related







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