Code Matches Two Rows With Six Cells In Different Sequences

Oct 22, 2013

Worksheet cells A1 – A25 have sequential numbers 1 – 24

the following elegant code generates every permutation of six numbers from the list into Cols C – H

VB:
Option Explicit
Sub Combinations()
Dim rRng As Range, p

[Code].....

View 7 Replies


ADVERTISEMENT

Restricted Value Sequences In Rows

Jul 18, 2006

I need to create a warning when specific values sequences are input from a
drop down menu. My example:

I have 31 columns (days in month) and have 25 rows (peoples names) from the
drop down box I have the following values-These are shift designations
(V1,V2,V3,V4, SV1,SV2,SV3,SV4, A1,A2,A3,A4,N,R1,R2,R3,DB,C).

If the selections in cell between B1:AF25 are either SV 1-4 or A 1-4 I want
a warning to appear IF a value of V 1-4, R 1-3, DB or C are attempted to be
put in the immediately following cell.

Example: Cell B3 has A-4 and in cel C3 they attempt to put N, then it
should give a warning "This is not a recommended shift sequence".

View 11 Replies View Related

Compare Dna Sequences In Cells

Sep 7, 2009

I am doing research and I have a list of over 100 small dna sequences that I would like to see if there are any similarities between them. I have put them in individual cells but I dont know how or what function to use.

View 11 Replies View Related

Return Matches & Non-Matches From Delimited Cells Against List Range

Jan 29, 2010

In my spreadsheet, on the first worksheet called "Working". Column A, called "Results", contains carrot ^ delineated string values in each cell (i.e."john^apple^pear^banana^grape^love^heart^pickle"). The majority of string values in every cell in my "Results" column match a "source" column of Pick-List Values, called "Fruits" in the same spreadsheet, however found in a different worksheet called "Lists" (also in Column A). I want to perform 3 functions against my "Results" Column on worksheet "Working":

1.) Report In Column B: Analyze column "Results" by cell and return carrot delineated string values for only those that match my "Fruits" Pick-List

2.) Report In Column C: Analyze column "Results" by cell and return carrot delineated string values for only those do not match my "Fruits" Pick-List

3.) Report In Column D: Identify and return all unique values in "Column C" as a List.

Attached is a simple example of what I'm trying to accomplish called " Sorting.xls"

View 4 Replies View Related

Copy Certain Value From Row To Another Row When Code Matches?

Jun 20, 2014

I got here different vessel name with corresponding vessel code and a amount. I needed to put the amount the to corresponding vessel if it matches the vessel code. Further explanation are in the attach excel file.

View 9 Replies View Related

Colors The Zip Code That Matches The One Input

Aug 4, 2009

I am trying to build a simple spreadsheet for my salesman that given a customer's zip code, it looks up the corresponding territory code for that zip code. I have conditional formatting setup so that it colors the zip code that matches the one inputted, but how do I then return the value of the corresponding territory code. The spreadsheet being searched is a simple 2 column list, with the headings: Zip Code and Territory. What's the best way to get the territory code back to my worksheet?

View 9 Replies View Related

Macro Code To Filter Out 'Exact Matches' In 2 Columns

Nov 29, 2006

I have a large worksheet in drive C: called 'hits.csv' that has manufacturer part numbers in column G and column L.

I need macro code to find all rows in the worksheet where the part number in each cell in column G is exactly the same as the part number on the same row in the corresponding cell in column L. The macro should then delete/remove all rows where there is no exact match.

Note: The part number in every cell in column G is the only thing that is in each cell in that column. However just to warn you that the part number in every cell in column L is at the beginning of each cell, followed by a space and then a description of the part.

Once it has done the above, I would also like this macro code to open a worksheet called 'partnumbers.csv' in drive C:. It should then compare the part numbers in column A of this file with the part numbers in the above worksheet ('hits.csv'). The cells in Column D of the file 'partnumbers.csv' all contains a price. Where the macro finds an exact match on the part numbers in these 2 files, it should copy the price from the cell in column D in the file 'partnumbers.csv', into Column K of the other file, 'hits.csv' where the match exists.

View 9 Replies View Related

Rows Value Matches Lookup Value

Nov 16, 2006

The table i'm looking up contains 2 rows with a value which matches my lookup value, how do i get the vlookup to pick up both values?

this is what i have:
ACEUSA-0017,730.84
SISTRUINSU-0018,865.69
WARNORAMER-00212,868.59
ACEUSA-00113,948.61

This is what vlookup picks up:
ACEUSA-001 7,730.84
ACEUSA-001 7,730.84

using this formula:
IF(ISNA(VLOOKUP(I13,'May 2006 MJ'!$A$5:$B$41,2,FALSE)),0,VLOOKUP(I13,'May 2006 MJ'!$A$5:$B$41,2,FALSE))

This is what i need it to pick up
ACEUSA-001 7,730.84
ACEUSA-001 13,948.61

I do need ISNA to take care of #N/A

View 14 Replies View Related

Largest And Smallest Sequences

Jan 12, 2009

I am using excel 2007 and I need help with the following if anyone would be kind enough. I have a dynamic array that consists of stream of 1's and 0's. I want to be able to find the largest sequence of 1's and the smallest sequence of 1's. So at a point in time the array mite be 111110001101111000 and I want to be able to dertermine the longest contiguous sequence of 1's. But as I say the array is dynamic and so I need to do that after each input.

View 8 Replies View Related

Compare The Binary Sequences

Nov 18, 2008

I have 70 sequences of binary coded variables each, which I would like to compare in terms of overlaps for the number "1", e.g.,


a1 1 0 0 0 0 1
a2 0 1 1 1 0 0
a3 0 1 1 0 1 0
.
.
.
a70 0 1 0 0 0 0


How can I do a pairwise comparison in Excel for the number "1" (ie how often does the number "1" occur at the same place for two sequences?).

I thought about a correlation matrix (that compares sequences a1-> a2, a1-> a3, a1->a4, ...., a1-> a70; a2->a3, a2-> a4, ...., a2-> a70; .....; a69-> a70), but am looking for an easy way to compute this in Excel.

View 6 Replies View Related

Formula For Counting Sequences

Apr 1, 2007

I want to write a formula that counts sequences.

Details of Data:

Imagine you roll a 4-sided dice! The four sides of the dice are 1,2,3 and 0.

Sequence needs to be 5 in a row of either 1 and 2, 1 and 3 or 2 and 3. The 0 is to be recorded, but 'skipped over' in the sequence.

When a sequence of 5 occurs, there needs to be a count to record how many more times the missing number takes until it arrives. For example, if the sequence of 5 is 1 and 2, and the count will be to see how long it takes the number 3 to arrive.

View 9 Replies View Related

Lookup Value Based On Specified Number Sequences?

May 8, 2014

I need to come up with a formula that will lookup a value in a table based upon a specified number sequence in another table and then add that value to another number/price that corresponds with that specified number sequence.

In the attached worksheet you will see that there are two groups of tables (A & B). I want to take the prices in group A in columns B:E and then add the values at the top of the page in columns G:J based upon specific numbers to the right of the decimal place in column A under "Rate".

So in the example at the bottom you will see that the first rate in column A is 5.125. Since the rate ends in .125 then it should be using the value of 2.57 from J2. So it should take the price in B27 (108.328) and add 2.57 to give you 110.898 in M27.

My problem is that the rate sequence wont always be the same and neither will the values in columns G:J. The only constants are that the rates will end in 1/8ths and the values will be based upon which 1/8ths they end in. For instance; In the example the rate range goes from 5.125 down to 3.75 but sometimes it may be 5.625 down to 4.25.

View 12 Replies View Related

Finding Sequences And Highlighting Them In Different Ways

Mar 18, 2009

how to go about finding sequences and highlighting them.

here's an example list:

7600
7601
7602
7603
7604
7608
7609
7610
7611

now i need to find 3 things in this list.

1) how many 'batches' of sequences there are in this list. The numbers 7600 to 7604 are a consecutive sequence of five numbers followed by another sequence from 7608 to 7611. that makes two sequences. i need a formula for one cell that would specify how many sequences there are in a given list (in this case they're two sequences in this list).

2) is there any formula that can allow me to see each sequence highlighted in a different color (or any way to differentiate the sequences so i can copy paste them easily?). Pretty sure i'd have to use conditional formating on the entire list to do so but am clueless as to the implementation.

3) a formula for a single cell that can state the largest sequence in the list. in the list above the largest seuqnce is 5 numbers so that would be the value i'm looking for.

View 9 Replies View Related

Code Runs When I Hide Rows Or Delete Cells

Aug 2, 2008

So i don't have any events that i know of that should trigger my macros to run. But everytime i delete a cell, or hide rows, it seems all my code/macros just auto run. And i had a few times when i hid the rows, the code would start, and then my excel application would crash.

View 4 Replies View Related

Getting Rows From Separate Sheet That Matches A Condition?

Mar 10, 2014

If I have these on Sheet 1

Name Age Cutoff
PersonOne 27 21
PersonTwo 21 20
PersonThree 19 19
PersonFour 17 20

generate/list/display on the next sheet (Sheet 2) of all the rows that has AGE less or equal to Cutoff, so on Sheet 2 based on the Sheet 1 data, I should get the following rows listed:

Name Age Cutoff
PersonThree 19 19
PersonFour 17 20

View 10 Replies View Related

Macro To Automate Copy/paste Sequences

Nov 5, 2008

I have a spreadsheet tool that I use to calculate values on a set of variables, based on values on an initial set of other variables, for a large number of cases.

The calculations require a number of sequential steps to be repeated to get the calculated values for each case, and I am hoping there is a straightforward way to use a VB macro to automate this process.

Essentially, these steps are required to calculate values for a single case:
1. A data input sheet holds the values on the initial/input variables for each case. The first step involves copying the string of values for the case on the input variables into a sheet where the calculations are done.

2. As soon as the input string of values are pasted into the calculation sheet, the calculation formulas generate values for the case on the new, output variables.

3. The output variable string is then copied from the calculation sheet into a “results output” sheet. This copy/paste procedure needs to offset from the first row on the output sheet, so that the row number where the values on the output variables are stored correspond to the case ID. For example, case ID 10 is stored 10 rows down from the first row (i.e., on row 11). Case ID 100 is stored 100 rows down from the first row (i.e., on row 101).

As there are a very large number of cases, I need to have a “control panel” in place, where I can indicate the range of case IDs that will be processed. This takes the form of two cells – one indicates “From ID” and the other “To ID” (for example, “From ID” 1 “To ID” 100). The macro then uses this information to loop through the calculation steps outlined above for these case IDs.

View 4 Replies View Related

Match 2 Columns Across Two Sheets & Copy Rows Of Matches

Jan 20, 2009

I would like to match column data in a source spreadsheet to column data in a target sheet. If a match is found, I would like to copy the corresponding row range from the source sheet to a separate, third sheet. For values where no match in found in the a target sheet, I would color the unmatched cell in the target sheet red. If a match was found, the cells would be colored green. The data in the Source sheet is in column A, while the Data in the Target sheet is in Column T. The data will be pased in the third sheet in Column T preserving original formats

I have this code, gleaned from several postings on this forum that somewhat works. The problem is that I get false mismatches (i.e. some cells get colored red even when there is a match and the data got copied to the third sheet) even though there are no duplicates. I have made sure that the formats are identical in both Target and Source sheets to try to fix this. Also, I don't want to cut the entire row , but just copy and paste a row range onto a third sheet. The column and row ranges are variable. I am attaching a file.!!

Sub CutRows()
Dim i As Long, k As Long, n As Variant, r As Range
Application. ScreenUpdating = False
With Sheets("Source")
Set r = Range(.Cells(1, 9), .Cells(65536, 6).End(xlUp))
End With
k = 0
i = 6
While Not IsEmpty(Sheets("Target").Cells(i, 20))
n = Application.Match(Sheets("Target").Cells(i, 20).Value, r, 0)
If IsNumeric(n) Then
Sheets("Target").Cells(i, 20).Interior.ColorIndex = 35
k = k + 1
Sheets("Source").Rows(n).Cut Sheets("Sheet3").Rows(k)
Else
Sheets("Target").Cells(i, 20).Interior.ColorIndex = 3
End If
i = i + 1
Wend
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

View 7 Replies View Related

Delete Rows If Opposite Column Cell Matches

Sep 6, 2006

I have a spreadsheet that is updated daily with data that falls into one of two categories: a) completely new to the sheet or b) existing from the day before but not taken care of yet. The items which fall into category a are evaluated, and notes added to the sheet. The items in category b must be compared to the new data, and duplicated lines deleted but notes from previous evaluation must be kept on the sheet. In addition, anything on the sheet that is not included in the new information needs to be deleted. I've set up a sheet with all old and new data with dates the data showed up as well as the notes associated with the old data, and have concatenated all the info from each row into column V (from another suggestion I got on a similar but not exactly the same problem which I also still haven't figured out). The sheet has been sorted by col V so any matching rows should be within 3 or 4 rows of the original. The problem is that my code does absolutely zilch!

Sub DeleteRepeatedRows()
' goes through coord. sheet and identifies duplicated lines, copies the date from the old row
' copies it into the new line, then deletes the old line
Dim rCell As Range
For Each rCell In Selection
If rCell.Value = rCell.Offset(1, 0).Value Then
rCell.EntireRow.Delete
End If
If rCell.Value = rCell.Offset(2, 0).Value Then
rCell.EntireRow.Delete
End If.........................................

View 7 Replies View Related

Cross Check 2 Ranges For Matches & Return Row Number Of Matches

Apr 29, 2009

I have several worksheets (Labeled Sheet1,Sheet2,sheet3) What I need to do is to step through each row in sheet3, and do a search in sheet1, it the data was found, then return the row number. I then will need to copy data from sheet1 (rowfound columnA , through rowfound CoulmnBd to sheet3 current working row columnK

View 3 Replies View Related

Comparing Two Columns On Different Worksheets And Adding Rows Where Matches Occur

Jan 18, 2014

Essentially what I want to automate is a check through one list on the Sheets("Notes") in column A, with another column B on Sheets(template). If there is a match I want to insert a part of the row that the match occurred on Sheet("Notes"), and insert it above the row where the match occurred on Sheets(template).

Here is my code so far, currently I keep getting a "Application-defined or object defined error" on the line

VB:
Sheets("Notes").Range(Cells(i, 2), Cells(i, 11)).Copy
VB:
Sub add_notes(template As String)
Dim Rng As Range
Dim i As Integer

[Code].....

View 5 Replies View Related

Placing Numbers In Sequence Down Rows And Duplicating If Information Matches?

Mar 7, 2013

I have 2 columns,

column A has a series of 8 digit numbers (some will match some will not) sorting in A-z order from lowest to highest value.

Column B is blank at the moment.

What I want

In column B i need to add numbers starting at 1 and moving down in sequence.

If more than one rows have the same number in column A they get the same numbe rin Column B

It's really a pain or have to hand type in the numbers and I can't figure out a easy way to do this.

Attached example.

Tab 1 = Origanl Data
Tab 2 = results i'm lookin for.

View 2 Replies View Related

Color Table Rows Where Specific Cell In Row Matches Condition

Jul 2, 2008

I have a selection on a worksheet that has 4 consistent columns (A, B, C, and D) each with a variable number of rows all containing string type data. With this data I want to use Conditional Formatting so that when I have a string value of X in column D for any row, that whole row with the X in column D has it's color change to say grey, this should happen regardless of what strings are in Columns A, B, or C.

Below is the way I've been trying to do this thus far and failing, when I run this code below I can only get it to grey out the cell with the X not the whole row.

Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""x"""
Selection.FormatConditions(1) . Interior.ColorIndex = 16

View 4 Replies View Related

Macro To Copy Data From Columns And Paste In Rows After Given Criteria Matches?

Nov 21, 2011

I have a macro that would check data in Column A and validate if a particular number is repeating, then for that number go to column B, Take the Values from there go to a new sheet and paste the values in a row.

CurrencyDateRef CodeIDAccountAmountDes.USD07152011XDVU4315210.4200.C5001.USD-18,606,772.190Distr Payable 07152011USD07152011XDVU4315210.4200.C5002.USD-111,131.450Distr Payable 07152011USD07152011XDVU4315420.4240.C5001.USD18,606,772.190Distr Payable 07152011USD07152011XDVU4315420.4240.C5002.USD111,131.450Distr Payable 07152011

I get the data in the below format

CurrencyDateRef CodeIDAccountAccountAmountDes.USD07152011XDVU4315210.4200.C5001.USD420.4240.C5001.USD-18,606,772.190Distr Payable 07152011USD07152011XDVU4315210.4200.C5002.USD420.4240.C5002.USD-111,131.450Distr Payable 07152011

I need to the macro to get the data not from the second cell.

Below is my macro

Sub test()
Dim idRange As Range, c As Range
Dim uniqueID As String
Dim destSht As Worksheet, sourceSheet As Worksheet
Dim r As Long
Dim i As Integer
Dim map As Object, key, item

[code]....

View 2 Replies View Related

Delete Rows If Column Has Fewer Than X Matches To Part String Match

May 5, 2008

I have data sets on multiple worksheets within a workbook (over 70). Based on the begining of a string, I need to count all instances with that begining, and if there are fewer than 12 instances, delete the entire row.

Data set example:

In this example, I need to count each instance of rows starting with 1/* - 9/*, and delete rows as mentioned. In other data sets the string might start Gi1/*, and so on. In the following code, if I do not loop, and only test against 1 value type, and ONLY run it once, it works. As soone as I try to loop through all possibilities, or run the macro a second time, it blanks out the entire worksheet, starting at row 3.

Dim c As Long
c = Worksheets(i).Range("A" & Rows.Count).End(xlUp).Row
With Range("A3:A" & c)
If Application.WorksheetFunction.CountIf(Worksheets(i).Columns(1), "1/*") < 12 Then
. AutoFilter field:=1, Criteria1:="1/*"
.Offset(1).Resize(.Rows.Count - 1, 1).EntireRow.Delete
.AutoFilter

I have also tried to concatenate a variable with my CountIf criteria, but that fails miserably.

View 6 Replies View Related

Excel 2010 :: VBA Code To Search Multiple Columns And Delete Any Duplicate Cells (not Rows)

Jun 12, 2014

My Excel program (Excel 2010) currently has several columns and each column looks for and pulls data from a specific file on my computer. Then I need to delete any duplicate data entries, count the number of unique entries and track the changes through a chart. I have everything done except I cannot figure out (or find on the internet) a way to search in multiple columns (more than 2) and delete just the duplicate cells. I want to delete the cells in a way where there is one left. For example if the code 12gf is duplicated three time, I want to be left with one 12gf (it doesnt matter what column the original one is left in). Additionally, column length changes and they are not sorted. I have attempted to attach an image of an example file below.

View 14 Replies View Related

Excel 2010 :: VBA Code For Inserting Text In All Column B-cells Of Multiple Selected Rows

Jul 11, 2012

Software: Excel 2010, Windows 7

What is the VBA code for inserting text in all column B-cells of multiple selected rows?

I am creating a worksheet with a table containing various data related to orders of various materials (this is more or less data gathering from an older, paper-based 'system'). This table spans, columnwise, from A to D and expands downwards as more orders are added. The information in each column is: A=order number, B=type of material and C=material specs. and D=additional comments.

I've set it up so that the only thing I really have to do is to insert the type of material in the cells of column B, and the rest will sort itself out. Instead of having to insert a new row for each new entry and manually typing in the name of the material (these entries are often done in the midst of already existing data), I created several similar, macroed buttons for the different types of materials we use. These macros work by selecting the row of the currently active cell, inserting a new row and then add the name of the material in the column B-cell of this new row. What I am having trouble doing though, is to get the text-entry to work for a selection of multiple cells.

As an example, lets say that I would like to add 5 orders of "Grade A Steel" in the middle of the table - in the row above row 8. With the macro I currently have I can select cell B5, click the macro, and a new row will be inserted with "Grade A Steel" in column B of this new row. This action could be performed 5 times over, but would be easier if I could just mark a range of 5 cells, say B8:B12, click the macro and get the text/data inserted the column B-cells of all 5 of the new rows. So far I've been able to create a macro that inserts multiple new rows, but I've only been successful in filling the column B-cell in the first row leaving the 4 below empty.

View 8 Replies View Related

Insert Cells Until Data Matches Up

Sep 14, 2008

I have posted in a existing thread at mrexcel as i believe my problem and possible solution is very similar to that already detailed there. However i have not recieved a response there yet and was looking to draw upon more minds here ...

View 9 Replies View Related

Color/Highlight Cells Value That Matches Another

Sep 3, 2006

Example:

On sheet "Inventory List" is the value there is a value in cell A2. If that value is found in sheet "FHS Locker List" I would like the box highlighted. (I can do the highlighting) I would like to copy the formula down for cells A2-A900. It would be looking in cells K3-K900 in the "FHS Locker List" sheet.

View 5 Replies View Related

Copying Adjacent Cells From Matches In Other Worksheet

May 8, 2014

I have a spreadsheet which has a source worksheet, containing 2 columns with thousands of client numbers and account numbers. I have a destination worksheet which contains certain account numbers which are featured in the source sheet.

What I need to do is pull the matching client numbers across from the source sheet into the destination sheet. An example is attached.

View 5 Replies View Related

How To Find Matches Between Two Columns And Copy Cells In Row

Jan 15, 2013

I've just started with VBA and are trying to figure out following:

I'm using a validation list where the user choose one of twelve alternatives. The option she or he made is found in one or more rows in column B. If there is a match between the alternative in the validation list and in column B I want to copy some of the cells in the same row as the match in column B (to be exact, I want to copy the cells in column E, J, N and P) to another sheet.

I've succeeded doing this with one row but I don't know how to do without using that same code over and over again until Excel has made it trough all the rows. And there is over 200 of them.

View 2 Replies View Related







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