Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
then use instr
from: If StrComp(cell, cell.Offset(rowoffset:=0, columnoffset:=1)) = 0 Then cell.Delete Shift:=xlToLeft If instr(cell.Offset(rowoffset:=0, columnoffset:=1),cell) 0 Then cell.Delete Shift:=xlToLeft "Johnny B" wrote: Thanks Joel!, this only works if Column A is identical to the entire cell in column B. For example |American Online | American Online | running the macro will give |American Online | (empty) | however, if there is |American Online | American Online, John Johnson | nothing happens. Running the macro will give: |American Online | American Online, John Johnson | thanks for your help! ~johnny b "Joel" wrote: try this code Sub CompareAB() Lastrow = Cells(Rows.Count, 1).End(xlUp).Row Set MyRange = Range(Cells(1, 1), Cells(Lastrow, 1)) For Each cell In MyRange If StrComp(cell, cell.Offset(rowoffset:=0, columnoffset:=1)) = 0 Then cell.Delete Shift:=xlToLeft End If Next cell End Sub "Johnny B" wrote: Hey Guys, I was wondering if there was a way to create a macro (not substitute or concatonate) that would Find information from Column A and Remove it from Column B. For Example: from | Column A | Column B| | American Online | American Online, Bob | | Google.com | Google.com 123 Fake Street | to | Column A | Column B| | American Online | , Bob | | Google.com | 123 Fake Street | THANKS!!!! ~johnny b |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To find Multiple values in column B for a unique value in column A | Excel Worksheet Functions | |||
How to find the most recent date in a column based on other column | Excel Worksheet Functions | |||
find a specific value in a column and write another column | Excel Discussion (Misc queries) | |||
I need to find the Average from Column A - but Reference Column B | Excel Worksheet Functions | |||
Find if value in column A exists in Column B | Excel Worksheet Functions |