in Every cell in a Selection I need to replace a combination of characters. But before a replacement I want to count every combination. The problem is that CountIf function won't count at all. Though replacement performs.
Here is a code:
Option Explicit
Sub sdfsdf()
Dim rng As Range
Dim i As Integer
Dim Cell As Range
Dim Counter As Variant
'Application.Run "Personal.xlsb!Main"
Set rng = Selection
Set Cell = Cell
Let i = 1
For Each Cell In Selection
Let Counter = Application.WorksheetFunction.CountIf(Cell, i & "&")
Cell.Replace What:=i & "&", Replacement:=""
i = i + 1
Next Cell
MsgBox Counter
End Sub
A snippet of a column with combinations to delete. I need to delete 1&, 2&, 3& and so on.

Set Cell = Cellis redundant. TheLetkeyword is not used in VBA: just remove all occurrences. Please explain what exactly you are trying to count? Your code 'counts' (writes 1 toCounter) if the first cell is equal to1&, the second cell is equal to2&, ..., and replaces each occurrence in the cell and BTW making the cell blank (if true).