DELETE AWAY #N/A

Status
Not open for further replies.

ru_1985

New Member
Joined
Oct 4, 2006
Messages
35
How can i also delete away the #N/A with this code??


Code:
Sub MyDeleteFormula() 

    Dim myRange As Range 
    Dim myRange1 As Range 
    Dim myCell As Range 
    
'   Set range to check 
    Set myRange = Range("C5:J35") 
    Set myRange1 = Range("M5:T35") 
    
    
    
'   Loop through each cell in range and delete contents if value is blank 
    For Each myCell In myRange 
        If myCell.Value = "" Or myCell.Value = 0 Then myCell.ClearContents 
    Next myCell 
    For Each myCell In myRange1 
        If myCell.Value = "" Or myCell.Value = 0 Then myCell.ClearContents 
    Next myCell 
        
End Sub 
 
Code:
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi,

Code:
With myRange
    .SpecialCells(xlCellTypeFormulas, 16).ClearContents
    .Replace What:="0", Replacement:="", LookAt:=xlWhole
End With

HTH
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,606
Messages
6,120,484
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top