|
Dim my検索セル1 As Range
Dim Cel As Range, SavAd As String, Ct As Long
Range("F1:F9").ClearContents
With Range("E1:E9")
For Each Cel In .Cells
If Cel.Offset(, 1).Value = "" Then
Set my検索セル1 = .Find(What:=Cel.Value, After:=.Cells(.Cells.Count), _
LookIn:=xlValues, LookAt:=xlWhole)
If Not my検索セル1 Is Nothing Then
Ct = 0
SavAd = my検索セル1.Address
Do
Ct = Ct + 1
'my検索セル1.Select
my検索セル1.Offset(, 1).Value = Ct
Set my検索セル1 = .FindNext(After:=my検索セル1)
Loop Until SavAd = my検索セル1.Address
End If
End If
Next
End With
|
|