Compare and delete cell?

J

Jan

Monday Thuesday Wednesday
123 123 123
123 452 545
234 345 675
432
234

I want that the macro delete the cell in the column thuesday because
that's the same number as in monday. Also delete cell in Wednesday
because it is already in monday.

How to do this,

Thanks
Jan
 
R

Romanian37

Do you want to only delete the entries in column B or C the cell has th
same value as in column A of the same row, or if the value appear
anywhere in column A
 
F

Frenchie

hey,
something like that should do it. Check my spelling.

dim ws as worksheet
set ws as thisworksheet
dim x,y,z as integer
x=YourNumberOfColumns
y=your number of rows
for z=1 to y
do while x > 1
if ws.cells(y,x).value=ws.cells(y,x-1).value then ws.cells(y,x).value=""
x=x-1
loop
next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top