L
LuisE
I need to scan all used cells in column C from top to bottom and for those
with more than one occurence copy the cell contents one column to the left
and add as many "i" at the end as that cell is an occurence of the searched
cell or the occurence number.
Option Explicit
Sub wwweee()
Dim OccurCount As Long
Dim CellFound As Range
Dim i As Integer
For i = 1 To Range("C3").SpecialCells(xlLastCell).Row
For OccurCount = 1 To WorksheetFunction.CountIf(Columns(3), Cells(i, 3))
Set CellFound = Columns(3).Find(What:=Cells(i, 3).Value,
After:=Cells(i,3), LookIn:=xlValues, LookAt:=xlPart,
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
Cells(i, 2).Value = Cells(i, 3).Value & OccurCount - 1
Next OccurCount
Next i
End Sub
Thanks in davance
with more than one occurence copy the cell contents one column to the left
and add as many "i" at the end as that cell is an occurence of the searched
cell or the occurence number.
Option Explicit
Sub wwweee()
Dim OccurCount As Long
Dim CellFound As Range
Dim i As Integer
For i = 1 To Range("C3").SpecialCells(xlLastCell).Row
For OccurCount = 1 To WorksheetFunction.CountIf(Columns(3), Cells(i, 3))
Set CellFound = Columns(3).Find(What:=Cells(i, 3).Value,
After:=Cells(i,3), LookIn:=xlValues, LookAt:=xlPart,
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
Cells(i, 2).Value = Cells(i, 3).Value & OccurCount - 1
Next OccurCount
Next i
End Sub
Thanks in davance