VBA Macro To Extract All Unique Rows
Oct 28, 2013
I have the following table A
1
2
B
1
1
B
2
1
[Code] .....
I would like to extract all the unique rows from the above table so the outcome will be
A
1
2
B
1
1
[Code] .....
However I can't think of a simple macro to do it.
View 2 Replies
ADVERTISEMENT
Jul 3, 2008
This is just a screenshot of my huge data of over 60,000 rows. Owing to the restriction of HTML Maker, I am just showing in less than 30 rows in this screenshot.
I need to extract only the UNIQUE ROWS depending upon the column called "Unique Code" to another worksheet. A particular row or a record is repeated as many as 90 times in this database. I need to extract the whole row which is unique depending upon the column C which is "Unique Code".
I have tried the Advanced Filter option a couple of times but it does not seem to work. Also, the Auto Filter option is not versatile for such amount of data.
View 9 Replies
View Related
Apr 19, 2013
I have this data
1 355
1 243
1 567
2 456
2 443
3 889
3 890
3 123
and need to sort it in columns like this
1 355 243 567
2 456 443
3 889 890 123
View 2 Replies
View Related
Jun 12, 2009
This is a logic based macro that needs to compare values in 1 column above a specific cell and take action until the column has no more data. Here's what I'm trying to do (and I've also attached a sample of desired results):
1) I want user to input starting cell. So I need to create a button for that.
2) This is where the logic begins and I'm having difficulty.
From cell defined in button, I move up one cell in that column and compare that value to the original cell.
If the value is greater than original cell then logic needs 2 outcomes:
a) move up 1 cell in column and if that value is less than original cell, then extract that value and copy that value one cell to the right or 1c.
b) move up 1 cell in column and if that value is greater than original cell, then move up again, until find lesser value than original cell. Once we find value less than original cell, extract value and copy value one cell to the right or 1c.
View 2 Replies
View Related
Jul 25, 2008
I am working with a spreadsheet generated from software that keeps track of fuel usage for a large fleet of vehicles. The data comes out looking like the snapshot below.
******** ******************** ************************************************************************>Microsoft Excel - June Fuel Transaction Listing.xls___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA3=ABCDEFGH3 Transactions for CUSTOMER ID: 0000CUST7 Sales 4 5 6Product summary for Vehicle ID 00001080 7 8Product Description Transactions Quantity9 101 Unleaded 3 57.60 GL11 12Hose summary for Vehicle ID 00001080 13Site ID HoseGradeProductTransactions Quantity140001 2113 57.60 GLJune Fuel Transaction Listing [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
I am trying to get the data into a more convenient format for analysis. I need a macro that will:
1) Take the text "Product summary for vehicle ID 0000****", extract the last 4 digits of the text, and paste it where the 1 is under the Product heading (a10). Those digits are the actual fleet number, and I need to separate them out from the rest of the text. The digits will change for each vehicle, so the macro should just move down the spreadsheet doing the same thing for each instance (the setup you see is repeated for every vehicle).
2) Once the first goal is accomplished, I would like the macro to then go back through and delete every row except for the rows with the pertinent data in them. So this means I would only want one row per vehicle and all rows would line up directly below each other like demonstrated below.
******** ******************** ************************************************************************>Microsoft Excel - June Fuel Transaction Listing.xls___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA10=ABCDEFGH101080 Unleaded 3 57.60 GL111081 Unleaded 6 84.70 GL121122 Unleaded 5 47.00 GL131182 Unleaded 8 95.80 GLJune Fuel Transaction Listing [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
View 9 Replies
View Related
Jan 27, 2014
I have a spreadsheet that lists employees and their certifications. If an employee has multiple, then they will show up on as many rows as they have certifications.
The macro I have merges them into one row with a line break, but only the first column's unique value has been merged while the other columns containing their own unique values are duplicated when I want them to show up only once. Example: Jane Doe shows up 2 times on the report. Her name should only show up once on the row, not 2 times with a line break.
Here is the code. I have also attached an example of what I need. Because the attachment is a simpler version of the actual report, is it possible to specify which rows have the unique values and which ones don't?
View 2 Replies
View Related
Aug 27, 2013
I am trying to extract unique values from a column but i can't, i am using excel 2010 and i have try the formula: =INDEX(List;MATCH(0;COUNTIF(C1:$C$1;List)+(COUNTIF(List;List)<>1);0)) but nothing.
Example:
NAMES UNIQUE VALUES
ÎÎÎÎÎÎÎ ÎÎΡÎΣΠÎÎΡÎÎÎÎ ÎÎ¥ÎÎΣ ÎΡÎÎÎÎΣ
ÎÎÎÎÎÎÎ ÎÎΡÎΣÎ
ÎÎÎΥΡÎΣ ÎÎÎÎΥΣÎÎΣ
ÎÎÎΥΡÎΣ ÎÎÎÎΥΣÎÎΣ
ÎÎΡÎÎÎÎ ÎÎ¥ÎÎΣ ÎΡÎÎÎÎΣ
ÎÎÎÎÎΣ ÎÎ¥ÎÎÎÎÎÎΣ
ÎÎÎÎÎΣ ÎÎ¥ÎÎÎÎÎÎΣ
View 11 Replies
View Related
Feb 18, 2006
Given a long column of values, how do I extract only unique values? Small example > Values of 1, 2, 2, 3, 4, 4, 4, 5 in column A. Would like to extract unique values ... 1, 2, 3, 4, 5 ... and put them in another column.
View 13 Replies
View Related
Oct 4, 2006
I have a list with many names, several of them appearing more than once. I would like to extract the unique entries an then make the list of them.
I can do that using the filter. But can I do it with formulas ? (In order to, whaterever change is made to the first list, get the extracted one immediately updated).
View 9 Replies
View Related
Dec 23, 2009
I Want To Extract One Value From The Row Skipp Repeated
In Other Word Need Formula For Row Instead Of Advanced Filter, Unique
Sheet2 ABCDEFGHIJKLMNOPQRSTUVWX1Data123451234554512234511882Result123458 Excel tables to the web >> Excel Jeanie HTML 4
View 9 Replies
View Related
Feb 13, 2014
I am trying to populate a tab with all the unique values from a data table. For example, list all the SKUs, SKU Names, Buying Groups, etc. for "Owl Filled Candles" on the "COLLECTION - SKU" tab. For reference, the "VENDOR - SKU" tab works perfectly. I want the COLLECTION tab to do the same thing as the VENDOR tab. The only difference is the VENDOR-SKU tab is pulling data based on a Vendor's name in a drop-down list in B3 and the COLLECTION tab is pulling data based on the Collection name in a drop-down list in B3.
I tried to just copy the tab and reset the reference cells but that isn't working.
View 4 Replies
View Related
Oct 24, 2012
How can I extract the unique values from the original list but only those whose their SUMIFS is greater than zero? in my example "Blue" , "Yellow" & "Red" should not be extracted.
Sheet1  ABCDE1Original Unique2Purple10 Purple103Blue0 Blue04Pink1 Pink15Yellow0 Yellow06Green13 Green31
7Blue0Â Red08Green18Â Black29Yellow0Â Â Â 10Red0Â Â Â 11Black2Â Â Â 12Pink0Â Â Â 13Black15Â Â Â 14Purple6Â Â Â 15Red0Â Â Â
Spreadsheet FormulasCellFormulaD2{
=IFERROR(INDEX($A$2:$A$15,MATCH(0,COUNTIF($D$1:D1,$A$2:$A$15),0)),"")}E2
=IF(D2<>"",SUMIFS($B$2:$B$12,$A$2:$A$12,D2),"")D3{
=IFERROR(INDEX($A$2:$A$15,MATCH(0,COUNTIF($D$1:D2,$A$2:$A$15),0)),"")}E3
[Code] ...........
View 9 Replies
View Related
Nov 3, 2013
Extracing unique values based on two lists(2 sheets).
My scenario:
Sheet1 has 2 columns with one million lines. (Master sheet)Sheet1 ColumnA=serial numbersSheet2 has 200,000 lines with same format. columnA= serialsheet2 has some new serials and some existing serials
Serial is 18 digit number saved as text (dunno of that matters)
Solution:
how can I get vba to check serial agaisnt serial ( Sheet2 ColumnA against Sheet1 column A)extract all new serials (unique of sheet 2 only)unique lines to export to new sheet or replace sheet2
View 5 Replies
View Related
May 14, 2014
I have a very large table in Sheet 1, in the following range A10:1:3068.
Column C has the company name, and there are multiple instances of the same company name in this column.
(Columns E to I are part of a pivot table and I have various formulas in A thru D).
In column A I have a value indicating whether the company has 'exposure' (an internal meaning for our sales team). If the company has exposure, then the word exposure is indicated otherwise the cell is blank.
What I need to do is in Sheet 2, create a table that extracts a unique list of company names from column C only where it has the word 'Exposure' next to it in column A.
I would like this to be dynamic so if I change a value in the pivot table in sheet 1 the values in the table in sheet 2 will update accordingly.
I am figuring this is an index and match or perhaps a countifs.
View 9 Replies
View Related
Jan 24, 2009
I want to extract all those unique values in column A, if and only if, all their repeated values in A
have zeros in B. I mean, if one value appears N times in column A, and for the N repetitions its
respective value in B is zero, this value in A must be extracted from the list.
I was trying with count frequency of values, but I dont know how to extract
unique value with the required condition.
Example:
*ABCDEFGH1********2XYA-121******3XYA-120******4VVT_320******5VVT_320******6VVT_320******7RRT0******8UBN-550******9UBN-550******10PPT_431******11********12********13*Extracted values have all their repetitions with 0 in column B**14VVT_320Value extracted because appears 3 times, and those 3 times its value in B is 015RRT0Value extracted because appears 1 time, and that 1 time its value in B is 016UBN-550Value extracted because appears 2 times, and those 2 times its value in B is 0 Excel tables to the web >> Excel Jeanie HTML 4
View 9 Replies
View Related
Jun 18, 2007
I have a column which has about 600 Names, and some of them are repeated, so I want to extract the Unique of them into a separate column, How can I do that?
View 5 Replies
View Related
Sep 21, 2007
I have 2 sheets in a workbook. Column A on sheet 1 has numbers such as 123456, 123457, 123458 ect ect. Column A on sheet 2 has same amount of numbers but mostly different. However there are a few duplicates. QUESTION: How can i write a code that will fit in a new sheet lets say sheet 3 that will pull out only the list of numbers from sheet 1 and sheet 2 that are NOT duplicates?
View 5 Replies
View Related
Jun 16, 2008
I have data of different accident year. Now I need to identify different Accident Year and use them in Macro to do certain things. For example in the file attached I am using them in Msgbox. Now to acheive that I first extracted unique values using advanced filter on Column C and later use the different value to POP up the Msgbox. (This is achieved). Now I want to skip this part of doing Advance filter to extract unique value. Is there a way I can know unique value of data through the code itself and use them in program. here is what I am doing currently: I have delted the most of the data cause I am concerned with coulumn containing acc_year only.
Sub test()
Columns("A:A").AdvancedFilter Action:=xlFilterCopy, CopyToRange:= Range("C2" _
), Unique:=True
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("C3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("C3").Select
Do While ActiveCell.Value <> ""
MsgBox ("The Year is " & ActiveCell.Value)
a = ActiveCell.Row
Range("C" & a + 1).Select
Loop
End Sub
View 3 Replies
View Related
Feb 20, 2013
I wan to extract Unique values, here is the data for reference, I have made to tables the second table is desire result I wanted.
Sheet30 Â ABCDEFG1JOB #WASHQTYÂ JOB
#WASHQTY27800A1000Â 7800A100037801B1000Â 7801B100047802A1000Â 7802A100057800
A1000Â 7802C100067802C1000Â 7805B100077805B1000Â 7807D100087800A1000Â 7809D
100097807D1000Â Â Â Â 107802C1000Â Â Â Â 117809D1000
View 9 Replies
View Related
Feb 27, 2014
I've had a look at some examples of extracting unique values but it seems quite complex to me!
I have a list of customer names in column A, column B contains a material code (number format), column C contains the material information sheet (text & number format), column D contains the date that the material information sheet was sent (all column headers are in row 1).
Columns E, F & G follow the same format as above but for a different material code - this is repeated further in Columns H, I & J.
All of the material codes are different, but some material information sheets can be the same for some materials.
In column K I need to identify the unique material information sheet values for each customer, as some are duplicated.
Is this possible? There may be some blank values in the row i.e. a customer does not receive a certain material.
Perhaps just an easier way of organising the spreadsheet!
View 9 Replies
View Related
Jun 20, 2014
I can extract unique values from the list but thing is I need extracts only those values which match partially below is scenario
Column A has values ----
Column B has Countries..
so I need extract only those values which eg : Contry is "*Ind*"
Code:
=INDEX($A$2:$A$15,MATCH(0,COUNTIF($C$1:C1,$A$2:$A$15),0))
above formula I used to get unique values I need to add one more criteria which gives only matched.
View 1 Replies
View Related
Nov 17, 2009
I need to extract only unique email addresses from all the workbooks saved in C:EDT and its sub-folders. The sub-folders will be yearmonth. So there would be several workbooks in each C:EDT2010JAN, C:EDT2010FEB, C:EDT2010MAR...etc, etc. Also, in the future they would be in C:EDT2011JAN, C:EDT2011FEB, C:EDT2011MAR...Same for 2012, 2013, etc, etc.
In each workbook, the email addresses will be located in Column K of a worksheet called ACCOUNT. There is some other info in the column (Phone, Title, Name), but I don't need that.
I would like the email addresses copied and then pasted into either a new MS Word doc or a new Excel workbook/sheet. All the workbooks that contained the email addresses should then be closed.
View 9 Replies
View Related
Aug 27, 2007
I have a single excel data sheet with 10 rows of header information and then multiple rows and columns of data
I need to extract the 10 rows of header data plus the rows for each unique record in Col A into its own separate worksheet, with the work sheet name being the unique record from Col A
To further add to the challenge, the data in col A may have "/" in so will not comply with excel sheet naming convention so would like an error message to remind me to manually change a sheet name.
I attach an dummy data sheet just to show what I mean!
View 6 Replies
View Related
Feb 25, 2014
Working on data presentation. I have a log that is populated from elsewhere in the workbook. I would like to be able to have a table update itself as the log changes. In the table I need to capture each unique name and all dates associated with the name. I have a sample attached of what I hoped it would look like when working. Basically I have a place for the name and to the right, cells that represent the months of the year. The data captured has the date in mm/dd/yyyy format and I just need each monthly instance to land in the proper month column in the table. No need for date specific, just the month of the occurrence.
View 2 Replies
View Related
Jun 3, 2009
Hi, I'm very new to writing Excel Macro's and wanted to know if I could do the following. Conceptually, I understand what I need done and think it should be fairly straightforward.
There's 2 main events in this loop (I hope that's the correct terminology):
Input 1) User defines the beginning cell to start the loop. In this case, A2.
Input 2) User defines the range of columns/rows to display. The formula for rows that I've thought of is 4r. So if a user wants 20 rows below cells A2, they simply input 5 for r. The number of columns is a constant 5. So if r=5, then I'd want the range to be A2:E22......
View 13 Replies
View Related
May 31, 2012
Excel 2010ABCDEFGH1EMPLeaderSamAsbertNoellaJackson2RosalineSam3LionelAsbert4KerryNoella5JohnnyNoella
6AliAsbert7RosalineSam8TimothyAsbert9TimothySam10ReginaldAsbert11PascualJackson12MichaelSam13ReginaldJackson
14MeganJackson15ShellySam16CandiceSam171819Sheet1
Here's my problem... Column A contains employee name & column B contains Team Leader name of the respective employee. Range D1:G1 should contain names of team leaders from column B. After that, depending on the name populated in D1, cells going downwards from cell D2 should contain name of employees of that team leader. Similar thing should be repeated for columns E, F, & G. If an employee shows up under two team leaders then it should be displayed under both lists.
Is there any formula/VBA code which can do this? Been after this for last 3-4 hours and now just lost in a maze of various Index Match combinations and array formulas..
View 9 Replies
View Related
Sep 11, 2013
Here's how my daily report is currently set up:
ExternalInternalDifferences
123000123000
234564234564
345456345456
456567378987
565456456567
654547524564
788879565456
865478654547
745654
788879
865478
The External column contains data provided by an external vendor. The Internal column contains data compiled internally. The data in the Internal column will always contain data duplicate to the External column, but will also contain unique data not present in the External column. I would normally cut out the data contained in Internal column that is not duplicated in the External column, and paste it into the Differences column, and move the remaining cells in the Internal column up. The result would be the External column data and Internal column data would align by row, and the data unique to the Internal column is segregated to the Differences column, like so:
ExternalInternalDifferences
123000123000378987
234564234564524564
345456345456745654
456567456567
565456565456
654547654547
788879788879
865478865478
While not a difficult task for 8 rows of data, the actual daily report contains over 1000 rows, on average. I would like to set up a template workbook, where I can simply open the template workbook, paste the data into both the External and Internal columns, then have the values that are unique to the Internal column extracted from the Internal column and inserted into the Differences column.
The end product would be used daily, with differing amounts of data (from 100 rows to 10,000 rows).
View 8 Replies
View Related
May 30, 2014
I have two lists in different columns, which are defined ranges. I want to extract them to a unique list with an array formula and at the same time sort albafetically, without duplicates, like this:
List1
List2
Final List
Audi
Ford
[Code] ....
So far, I have this formula which is working in what concerns removing duplicates and exctract a unique list. But it is not ordering alfabeticaly.
{=IFERROR(IFERROR(INDEX(List1, MATCH(0, COUNTIF($D$1:D1, List1), 0)), INDEX(List2, MATCH(0, COUNTIF($D$1:D1, List2), 0))), "")}
View 2 Replies
View Related
Jul 3, 2007
Sheet1 has following two columns
----A----------B
01-07-2007---10
01-07-2007---20
02-07-2007---30
02-07-2007---40
02-07-2007---40
03-07-2007---60
03-07-2007---70
03-07-2007---70
03-07-2007---90
04-07-2007---100
04-07-2007---110
Sheet2 has following three cotrols
Textbox1=02-07-2007
Textbox2=03-07-2007
combobox=?
I want to Extract Unique values from column B between date range textbox1 and textbox2 and finally how to add these unique records in combox1
View 3 Replies
View Related
Jul 2, 2014
I am trying to extract unique Data from the information in the output data in the file attached after i have extracted data based on criteria from the database sheet. i have noticed that because i extract data from the database sheet and from there i perform the extraction of the of the unique data , it is not able to extract unique isser name form the output sheet.
View 1 Replies
View Related