Sub IGNOREINCONSISTENT()
Dim r As Range: Set r = Range("Your Range")
Dim cel As Range
For Each cel In r
cel.Errors(xlInconsistentFormula).ignore = True
Next cel
End Sub
Option Explicit
Sub Sample()
Dim ws As Worksheet
Dim rng As Range
Dim FRange As Range
Dim aCell As Range
'~~> Change this to the relevant worksheet
Set ws = Sheet1
'~~> Change this to the relevant range
Set rng = ws.Range("A1:A10")
'~~> Work with only those cells which have formula
On Error Resume Next
Set FRange = rng.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0
'~~> Check if there are cells which have formula
If FRange Is Nothing Then
MsgBox "No cells with formula found"
Exit Sub
End If
'~~> Filldown on cells which have Inconsistent Formula
For Each aCell In FRange
'~~> .FillDown in a single cell will pull the formula down.
'~~> Just like when you press Ctrl + D
If aCell.Errors.Item(xlInconsistentFormula).Value = True _
Then aCell.FillDown
Next aCell
End Sub
1条答案
按热度按时间b5lpy0ml1#
这就是你想要的吗?
代码
行动中