ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compare and delete cell? (https://www.excelbanter.com/excel-programming/305418-compare-delete-cell.html)

Jan[_12_]

Compare and delete cell?
 
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

--
--
Jan

United Kingdom, London

Romanian37[_6_]

Compare and delete cell?
 
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

--
Message posted from http://www.ExcelForum.com


Frenchie[_2_]

Compare and delete cell?
 
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



Jan wrote in message
...
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

--



All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com