Hi All,
I have a table where for whatever reason there is some discrepancy in the data
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]81357641212[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641213[/TD]
[/TR]
[TR]
[TD="align: center"]81357641000[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641213[/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"]AND[/TD]
[TD="align: center"]81357641000[/TD]
[/TR]
[TR]
[TD="align: center"]81357641000[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641000[/TD]
[/TR]
[TR]
[TD="align: center"]81357641000[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641213[/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am trying to automate the replacement of the discrepancies based on the values of the previous and next adjacent cells using a macro.
I have a formula that does this =IF(A6282=81357641000,IF(A6281<>81357641000,A6281,A6283)) but I need to manipulate much more then this alone and most of it is done by a Macro
So I am looking for something similar to this:
</next>
Any suggestions appreciated!
I have a table where for whatever reason there is some discrepancy in the data
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]81357641212[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641213[/TD]
[/TR]
[TR]
[TD="align: center"]81357641000[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641213[/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"]AND[/TD]
[TD="align: center"]81357641000[/TD]
[/TR]
[TR]
[TD="align: center"]81357641000[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641000[/TD]
[/TR]
[TR]
[TD="align: center"]81357641000[/TD]
[TD="align: center"][/TD]
[TD="align: center"]81357641213[/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]81357641212[/TD]
[TD="align: center"][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am trying to automate the replacement of the discrepancies based on the values of the previous and next adjacent cells using a macro.
I have a formula that does this =IF(A6282=81357641000,IF(A6281<>81357641000,A6281,A6283)) but I need to manipulate much more then this alone and most of it is done by a Macro
So I am looking for something similar to this:
Code:
Sub Modify()
Dim Cell As Range
Set TelRange = ActiveWorkbook.ActiveSheet.Columns("A").SpecialCells(xlCellTypeConstants, xlNumbers + xlTextValues)
For Each Cell In TelRange
With Cell
If .Value = 81357641000# Then
If [previous cell] .Value <> 81357641000 Then
.Value = [previous cell value]
Else .Value = [next cell value]<next cell="">
End If
End With
Next Cell
End Sub
Any suggestions appreciated!