ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting cells in Macro (https://www.excelbanter.com/excel-programming/354055-deleting-cells-macro.html)

MSHO

Deleting cells in Macro
 
I have a macro that compares two sets of data. Sometimes there isn't data and
so there is a #DIV/0! symbol. How do i go through the cells and delete all of
these?

Thanks in advance


Ron de Bruin

Deleting cells in Macro
 
Try this for column A

With Columns("A:A")
On Error Resume Next
.SpecialCells(xlCellTypeFormulas, 16).ClearContents
On Error GoTo 0
End With


--
Regards Ron de Bruin
http://www.rondebruin.nl


"MSHO" wrote in message ...
I have a macro that compares two sets of data. Sometimes there isn't data and
so there is a #DIV/0! symbol. How do i go through the cells and delete all of
these?

Thanks in advance





All times are GMT +1. The time now is 05:30 PM.

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