Hi, Give This a try:
Sub rng()
Dim cell As Object
Dim r As Range, rr As Range
Dim lrow As Long
Dim rfound As Range
For Each wks In Worksheets
wks.Activate
If wks.Index > 2 Then Exit For
lrow = Sheets(3).Cells(Rows.Count, 1).End(xlUp).Row
Set r = Sheets(3).Range("A3:A" & lrow)
For Each cell In r
Set rfound = wks.Cells.Find(What:=cell, After:=Range("A2"), LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
If rfound Is Nothing Then
Else
Set rr = wks.Range(Cells(rfound.Row, 3), Cells(rfound.Row, 11))
For Each cel In rr
cel.Select
If Cells(cel.Row, 1).Value = vbNullString Then Exit For
If IsEmpty(cel) Then
cel.Value = cell.Offset(, 1).Value
cel.Offset(, 1).Value = cell.Offset(, 2).Value
Exit For
End If
Next cel
End If
10
Next cell
Next wks
End Sub
Here is a test book as well
...
Bookmarks