View Single Post
  #2   Report Post  
anilsolipuram
 
Posts: n/a
Default


I am assuming that column A as the id number COLUMN , which we need to
search and column b is the adjacent column which need to be incremented
when ever we find a match.


try this macro and let me know

Sub Macro1()
Dim INIT, I As Variant
I = 0
Columns("A:A").Select 'column a for serching
Selection.Find(What:="GO:0005524", After:=ActiveCell,
LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False).Activate 'searching a id
INIT = ActiveCell.Address
Range(INIT).Offset(0, 1).Value = Range(INIT).Offset(0, 1).Value + 1
'incrementing adjacent column
While I = 0
Selection.FindNext(After:=ActiveCell).Activate
If ActiveCell.Address = INIT Then
I = 1
Else
Range(ActiveCell.Address).Offset(0, 1).Value =
Range(ActiveCell.Address).Offset(0, 1).Value + 1
End If
Wend
End Sub


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=380164