View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
squenson via OfficeKB.com squenson via OfficeKB.com is offline
external usenet poster
 
Posts: 78
Default Delete in row C if it is repeated in row D

There is no possibility to erase the content of a cell with a formula or a
conditional formatting, only a macro can do it. However, you can hide the
content of a cell with conditional formatting, by using white font on white
background.

Select column C, then click on the menu Format Conditional Formatting, then
make sure you have
"Cell Value Is", "Equal To", "=$D1" (without quotes), then click on the
button Format and select white color font.

If you want to erase the content of the cells, then this macro should do it:

Sub DeleteSameValue()

Dim i As Long

For i = 1 To 65536
If Cells(i, "C") = Cells(i, "D") And Cells(i, "C") < "" Then
Cells(i, "C") = ""
End If
Next i

End Sub



calibansfolly wrote:
All my searches have lead me to ways to eliminate duplicates in a
column- not what I'm trying to do... If the value in column C is the
same as the value in column D for the same row, I want to erase it. Is
there an easy way to do this? (I think I remember reading about a way
with conditional formatting once.)


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200707/1