Posts by jolivanes

    Thanks for letting us know.

    Very much appreciated.

    Good Luck.


    If the previous code is too slow, this should be faster.

    Try

    Since you have a very small range, this should do.

    Code
    1. Sub Maybe_1()
    2. Dim lr As Long, lc As Long, i As Long, j As Long
    3. lr = Cells.Find("*", , , , xlByRows, xlPrevious).Row
    4. lc = Cells.Find("*", , , , xlByColumns, xlPrevious).Column
    5. For i = 1 To lc
    6. For j = 1 To lr
    7. If Cells(j, i).Value = "NV" Then Cells(j, i).Value = Cells(j, i).Offset(-1).Value / 2 + Cells(j, i).Offset(1).Value / 2
    8. Next j
    9. Next i
    10. End Sub

    If all data is numerical with the exception of the "NV" Cells, following should work also.

    Code
    1. Sub Maybe_2()
    2. Dim c As Range
    3. For Each c In ActiveSheet.UsedRange.SpecialCells(2, 2)
    4. c.Value = c.Offset(-1).Value / 2 + c.Offset(1).Value / 2
    5. Next c
    6. End Sub

    Is this what you mean?

    I have not looked at you .bas file.


    It assumes that Column C is sorted as you mentioned in your first Post.

    You mention "cut all and copy"

    You can "Cut and Paste" or "Copy and Paste"

    If you don't want to delete the copied range, comment it out (see code).


    A Gentleman that goes by ZVI suggested this: (Change as required)