Hi the foll code does not run when i include the if statement
Sub f()
Dim CurrentCell, NextCell
Set CurrentCell = Range("Shares")
j = 0
niter = Range("Shares").Count
For i = 1 To niter
Set NextCell = CurrentCell.Offset(1, 0)
'If NextCell.Value = CurrentCell.Value Then
'End If
Set CurrentCell = NextCell
Next i
End Sub
RunTime error 13, type mismatch
Plz help
Sub f()
Dim CurrentCell, NextCell
Set CurrentCell = Range("Shares")
j = 0
niter = Range("Shares").Count
For i = 1 To niter
Set NextCell = CurrentCell.Offset(1, 0)
'If NextCell.Value = CurrentCell.Value Then
'End If
Set CurrentCell = NextCell
Next i
End Sub
RunTime error 13, type mismatch
Plz help