Replace Value From One Column On A Range Of Rows On Other Column

Aug 24, 2012

I have a table in the format below. Pin_11 in this table is CLK and Pin_12 is STRB. I want to replace Pin_11 with PIN_CLK. Basically I want to look for CLK in Column3 and record what ever is in Column1 and Column2 on the same row (base row). For every repetion of that value in column1 and column2, in the rows above and below the base row, I want to replace column 2 with PIN_<column3 value>.

See below for initial table in column 1,2,3 and final result in column 6,7,8. I have a huge file this format of data that I need to end and was wondering if there is a script or formula to do it.




[Code] ....

View 2 Replies


Replace Numerical Data Column A, 11K Rows! VBA

Feb 8, 2009

Need to sort my data in column A which contains a long list of numerical data. To do this manually using copy and paste would be easy, but not viable because of the large amount of data.

The attached PDF file illustrates the data. I wish to replace each date of dirth entry in column A (one D.O.B. in each cell / row, expressed as YYYYMMDD) with the client identifier number (format 937XXXX) a couple of cells above. And at the same time delete the row containing the client reference (or its contents). The data in column A should retain the same relationship to the data in the other columns (B,C). it may require a short piece of VBA code.

View 3 Replies View Related

Remove / Replace ONLY FIRST Occurrence Of First Character In All Rows Of Column?

Jul 30, 2013

I need to remove the first character in each row of a column, but only its first occurrence in each row. For instance:

Say, column 2 has following data (lots of rows, by the way):

First Text" - "blabla"
=SomeText2 = "blabla"
SomeText3 = "blabla"
=SomeText4 = "blabla"
-SomeText5 --- "blabla"

I would like to use the VBA code to remove ONLY the FIRST occurrence of the FIRST character specified (either "=" or "-") in each row in that column, so that I get:

First Text" - "blabla"
SomeText2 = "blabla"
SomeText3 = "blabla"
SomeText4 = "blabla"
SomeText5 --- "blabla"
...and so on...

I tried to use this:

Columns(2).Cells.Replace What:="-", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
Columns(2).Cells.Replace What:="=", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
but it replaces ALL occurrences of "=" and "-" and that is not what I need.

I also tried this code:

With Range("B:B")
.Value = Replace(.Value, "=", "", 1, 1)
End With

But It doesn't work either.

View 7 Replies View Related

Copy And Replace Duplicate Values In Column Range?

Sep 18, 2012

I have following code (see below) which finds the duplicates within columns, but I require copying and replacing duplicate values within different row cells, as I am currently finding this task hard to implement.

Input Data example:


View 9 Replies View Related

Find Multiple Numbers In One Column And Replace With Single Phrase In Another Column

Jan 31, 2013

I have taken over this spreadsheet for my work, and it is basically a statement in excel. What I want to do is find a list of invoice numbers in column B populated from a remittance, and then replace column F to say a specific thing depending on check number and date paying for that invoice. So if a check printed today I would have it replace column f to say paid 1/31/13 check # xxxxx. Currently I am searching for each invoice indivudually and then replacing with check number and date. There are about 200 invoices per month that I deal with, and it is a big waste of time!

For example from this

invoice #1 / reconciled (DATE)
invoice #2 / reconciled (DATE)

To this:

invoice #1 / paid (DATE) check # (xxxxx)
invoice #2 / paid (DATE) check # (xxxxx)

View 2 Replies View Related

Compare Column B With All Rows In Column A If Match Place In Column C?

Aug 13, 2014

I want to compare two columns. I would like to see if the contents of column B appear anywhere in column A, for any amount of rows, and if it does, to place the match in col C.

So in the example below, red in B1 would be checked in A1 through A1000 or however long A is. When any row has red, place that match in that row for C.

This would be repeated until all rows in B are complete.

Col A: red
Col B: red
Col C: red

Col A: red
Col B: blue
Col C: not found

View 6 Replies View Related

Find In One Column Replace In Another Column

Apr 11, 2008

I want to find an instance of a word in one column......and replace whatever is in the adjacent column with a word.

View 12 Replies View Related

Copying Only Rows With Data In First Column - Skipping Rows With Blank First Column

May 12, 2014

I have 2 columns of data E and F. Column E has 11 different words that randomly repeat, Column F has 10 years of dates, about 1,000 entries (10/11/12 format). Both columns values come from formulas.

I am trying to copy cells E & F to columns K & L starting in row 2 only if there is is data in column E (one of the 11 words) and skipping all others rows. Both the E & F values of tthe row must be copied together, i.e if text is in E45, then copy E45 and F45 into column K and L starting with K2 & L2. This is a task which will be repeated multiple times as data is replaced in columns A-D.

View 4 Replies View Related

Find Rows W/same Value In Column A And B And Offset Column C To Next Available Column

Aug 3, 2006

I need to combine rows that have the same value in column a and column b to the same row by offsetting column c to the next available column. For example, I would like the first 6 rows of the provided sample to appear like this.

0014B22<@44>Soil Properties and Qualities<@44>Soil Properties and Qualities<@44>Soil Properties and Qualities

Sometimes the values are the same in column c, sometimes they are different. I do not want to delete duplicate rows where they are the same. Sometimes there are 2 rows that have the same values in column a and column b, other times there may be 3 or even 4 rows with the same values in column a and column b. Regardless, I would like the values in column c combined on the same row in the next available column. It would be nice if the duplicate column a and column b rows (with a null column c cell) were then removed, but I could do that in the next step.

0014B22<@44>Soil Properties and Qualities
0014B22<@44>Soil Properties and Qualities
0014B22<@44>Soil Properties and Qualities
0014B24<@33><i>Available water capacity:<p> High (about 11.5 inches)
0014B24<@33><i>Available water capacity:<p> Very low (about 2.9 inches)
0014B24<@33><i>Available water capacity:<p> High (about 9.0 inches)
0014B25<@33><i>Slowest saturated hydraulic conductivity:<p> Moderately high (about 0.57 in/hr)
0014B25<@33><i>Slowest saturated hydraulic conductivity:<p> High (about 1.98 in/hr)
0014B25<@33><i>Slowest saturated hydraulic conductivity:<p> Moderately high (about 0.57 in/hr)
0014B26<@33><i>Depth class:<p> Very deep (more than 60 inches)
0014B26<@33><i>Depth class:<p> Very deep (more than 60 inches)
0014B26<@33><i>Depth class:<p> Very deep (more than 60 inches)
0014B27<@33><i>Depth to root-restrictive feature:<p> More than 60 inches
0014B27<@33><i>Depth to root-restrictive feature:<p> More than 60 inches..............

View 9 Replies View Related

Selecting Range Of Rows In Column

Sep 11, 2013

I want to select a range of rows 11, 14 and 23 to 24 in column j, plus the 2 rows to the right of column J and run a sum formula on the range. My procedure is selecting rows 11/14/23/24 and doing the sum for only column J. How do I make it so it runs the sum formula on all 3 columns. My code is copied below. I am fairly new to VBA.

With ActiveSheet.Range(Cells(27, j), Cells(27, j)).Select
Set sumRng = Intersect(Range("15:21, 25:25"), Columns(j)).Offset(0, 2)
ActiveCell.Value = WorksheetFunction.Sum(sumRng)
End With

View 4 Replies View Related

Delete Certain Range Of Rows In Single Column?

Jun 10, 2014

I need to delete a certain range of Rows in a single column

View 3 Replies View Related

Dynamic Range For Table With Unequal Used Rows In Column

Feb 19, 2008

How would I select a dynamic range in VBA without using name a range in Excel. I have searched for possible answers, however they use xldown, or xlup which works great for non-empty cells. My problem need to select the area where there are empty cells. Here is a snap shot of the data looks like:

Trade Date A B C D E
2008-Feb-11 450,432

The cell with number is where I got the formulas. Now i wish to fill that formula with the rest of the area. However, the problem is the number of rows and number of columns may change in the future. So I need to select those empty areas in a dynamic way.

View 5 Replies View Related

Copy/Paste Rows By Numerical Range In Column

May 8, 2008

I would like it to scan an entire column (column E) for rows of data that fall into a range of numbers chosen by the user (like maybe a list box or combo box in sheet 1) for example a number greater than or equal to 8 but less than or equal to 15 and copy all of the rows and columns of data across the entire sheet that fit the range from sheet 1 to sheet 2. I would like to use a separate list or combo box for the min and max values in which to search as seen in the example sheet 1 attached. I have tried the autofilters, custom filters and macro recorder with no success as it seems the filters do not like ranges of numbers.

View 3 Replies View Related

Copy Range Rows To Another Sheet Matching Condition In Column

Jun 1, 2008

i'm trying to create a macro to find any value <> "" from COLUMN B then copy Bx;Cx;Dx and paste into another worksheet with the name of COLUMN A.

And when the cells Cx or Dx is empty should appear 0 into the other worksheet

for example.
sheet1 ..... cell("dx") is empty
a b c d
w 5 3

the macro would copy 5,3,0 and paste into sheet named "w".

i found this code on internet but it's not quite good for me because it copies the hole row. i tried everything to change that but i couldn't.


Sub SearchForString()

Dim LSearchRow As Integer
Dim LCopyToRow As Integer

View 9 Replies View Related

Command Button To Hide Rows Based On Date Range In Column A

Aug 22, 2014

In one spreadsheet, I want to have a command button that will hide all rows where the date column (column A) shows a date older than one week from today. When this button is clicked again, all rows will unhide again. Preferably the Command button title would change to reflect whether it is on the hide or show cycle (for example "Click to Hide all older than one week" and then "Click to Show all events") .

View 9 Replies View Related

Conditionally Format Each Group Of Rows And Each Column And Color The Cell In Each Column

Nov 27, 2009

I've a worksheet that is 3750 rows of cells from A to DT and contains only numbers with the exception of a header row. The rows are in groups, primarily 4 rows, although there are exceptions - these rows are separated by blank rows. Small example as follows.


I have been trying to conditionally format each group of rows and each column and color the cell in each column of four (or less) numbers in each group that represents the maximum number.
It was easy enough to come up with the conditional formatting BUT it will take forever to do this manually. I've been told to use a macro but I know nothing of programming. Has anyone seen or heard of a macro that might already be written to perform this onerous task.

View 9 Replies View Related

How To Count A Column If It Matches Data From Another Column In Seperate Rows

Feb 6, 2009

I have two columns with dates. Colum A has the date of the deadline of a document while column b has the day it was sent. Column X will display the difference if its a positive integer ( i.e. if the document has been sent after the deadline). Now i have another column Y which displays the month as an integer of when the document was actually received.

Now i need a counter which will count the number of instances a positive integer is registered in column X according to the month in column Y. I have been trying everything but cant figure a simple way to do it. Im doing this so i can be able to see how many documents are sent after the deadline per month.

View 14 Replies View Related

Delete Duplicate Rows Where Column A And Column B Combined Are Equal

Dec 8, 2009

I have a sheet where i want to delete duplicate rows where column A and column B combined are equal, i.e. range(Ax:Bx) where x is the current row. I am using the macro below but cant seem to get it working as I keep getting a type mismatch error and Im not sure why.

View 2 Replies View Related

Transpose Rows Keeping Heading In Column A And Data In Column B

Mar 2, 2011

I have an excel spread sheet with several rows of 265 (9A-IV) columns each with a heading. I would like to transpose the worksheet columns so that the heading is placed in Column A against the corresponding that is placed in column B. For example

ABCD14692571038Transpose to A1A2A3B4B5C6C7C8D9D10

View 7 Replies View Related

Adding Column Minus Rows That Have Data In Another Column

Feb 15, 2007

I want a cell on one spreadsheet (SP-A) to add up a column (M) in another spreadsheet (SP-B) rows 11 through 10000.

Here's the thing, I want that cell to actually display not the sum that it gets but that sum minus all numbers (in M column again) which column E is filled out with any data for their given row...

i'm not even sure if this makes sense lol... let me use example

on SP-B there's a column M.
in row 11, value = 3
in row 12, value = 5, in this same row column E is filled with whatever
in row 13, value = 2, in this same row column E is filled with whatever
in row 14, value = 6

in my SP-A I need the cell to display 9, since rows 12 and 13 have values in E and I don't want to add those to the sum.

View 9 Replies View Related

Find Most Recent Date In Column Headings In A Range - Insert New Column And Heading

Apr 4, 2014

I have a 2 groups of column headings with a different month and year in each heading so

1st Group of columns range
Columns AJ through AX
Column Heading example "Expense Ratio February Column over is "Expense Ratio March 2013"

2nd Group of columns range AY though CE
Column Heading example "Capital Balance February Column over is "Capital Balance March 2013"

Each new month I need to add a new Expense Ratio column after the most recent expense ratio Column. (i.e. Find "Expense Ratio March 2013" and I need to add a column after that with heading "Expense Ratio April 2013"

Same thing for Capital Balance - add a new Capital Balance column after the most recent Capital Balance Column. (i.e. Find "Capital Balance March 2013" and I need to add a column after that for "Expense Ratio April 2013"

Because the ranges keep changing month over month, how do i do this.

View 4 Replies View Related

Range Object/property: Calculates 2nd Column Based On 3rd Column's Number

Jun 1, 2009

I'm trying to write a code that calculates 2nd column based on 3rd column's number or vice versa based on the condition set on the 1st column. Below, there are two procedures. "SimpleCalc" and "SimpleCalc2". I first wrote SimpleCalc2, but it isn't working, so I worked around the error by writing SimpleCalc, which selects a cell and moves around by offset. I personally find it hard to read and error prone as I develop more logic around it.

I'm trying to develop more function based on this code, so I need to make it neat and flexible. what I'm doing wrong in SimpleCalc2? Or do you have any suggestion to improve the code "SimpleCalc"? I'm using Excel 2003.

Sub SimpleCalc()

Dim SimpleMethodRng, SimpleMethod As String, i As Integer


SimpleMethodRng = ActiveWorkbook.Worksheets("Dashboard").Range("N5:P12")

For i = 1 To 8

SimpleMethod = SimpleMethodRng(i, 1).........

View 3 Replies View Related

Return The Column Number Of First Column In A User Inputted Range?

Feb 19, 2009

I'm creating a macro that creates a co-ocurrence matrix from variables that are adjacent to each other.

In order to proceed, I need to know how to return the column number of the first (leftmost) column in a range that the user selects.

View 2 Replies View Related

COUNTIF: 2 Criteria: Date Range Column & Text Column

Dec 8, 2005

Col C = Text and Col F = dates
I would like to count the # of times a value occurs in Col C based on a date
range in Col F.

View 11 Replies View Related

Formula To Check Column A For Date Range And Count Column B

Oct 28, 2009

I have a formula that counts if a date range is present. However I need to change it to count another column only if that date range is present. For example a17 a50000 the user will enter the date of the order. and in column B has the order number. I want the formula to count the order numbers for a data range in column A.
Here is what I have but it is counting the dates in col A not the order numbers in B?

View 3 Replies View Related

Count How Many Cells Have Data In One Column If Within Date Range In Another Column?

Jan 22, 2014

I am trying to Count (or counta?) cells in one column if they have data but only if within a date range in another column.

So, in the example below, I would want to count how many cells in column E have data in them, but only if the date in column A falls between Jan 1 2014 and Jan 5 2014. (In this case, result should be 4).



View 4 Replies View Related

Copy Or Move Column Ranges From 1 Sheet To End Of Column Range Of Another

Mar 7, 2008

I have two different Excel reports and the data needs to be copied from each column on one spreadsheet and pasted to the bottom of the equivalent column on the other spreadsheet.

So, is it possible to get a macro that will copy the data from one column then paste it to the next free cell in the column on the other spreadsheet.

If I could get some code to do one column then this should be enough to get me started and I could apply this to the other columns I need to copy.

View 8 Replies View Related

VBA Search / Replace With Offset 1 Column And Offset 2 Column

Mar 22, 2013

I am trying to work out how to nest offset in a code using search replace. The goal is to find a value from cell A1 (example) and replace the values in the cells next to the cell containing samuel and the cell containing samuel.

A sort of search and remove data tool if you like So for example:

[QUOTE]A1: "samuel" (the search criteria)
Search range is: B1:D400
(for example)
Cell B40 = samuel
C40 = Driver
D40 = year

So, the macro is activated and finds "samuel" in B40 and I would like C40 & D40 replaced with "" The code I'm using is below: (this is just replacing the cell containing the search criteria with "test". I would like to nest offset(0,2) & offset(0,3).Value = ""

Sub Macro1()
Selection.Replace What:=Sheets("Sheet1").Range("A1").Value, Replacement:="test", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
End Sub

View 2 Replies View Related

Find / Replace From Column A Values To Column B Values VBA

Mar 6, 2014

I have a workbook with 20 sheets in English Language, but I must to translate in Russian. Translating has done by human translator, so translation is good. I must change phrases and words in english to russian. I can use find/replace function but doing by hand it's very tie consuming. I need VBA or macro who takes values in column A, finds it in entire worksheet and changes it to matching value in column B. Is it possible and how I can do it?

View 1 Replies View Related

Replace All In Column Except Certain Values?

Aug 23, 2013

One of the columns on my worksheet has a list of employees. I need to replace all the names with a blank (or delete) except for those employees on my team (7 employees). VBA code to Replace/Delete all EXCEPT (a,b,c,d,e,f).......?

View 2 Replies View Related

Copyrights 2005-15, All rights reserved