View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Using Find to Cut & Paste

Assume the code number is in column A and the description
in column B of the Index sheet.
Assume the code number is in column A of all other sheets.


Sub getDescript()
Dim sh As Worksheet, lr As Long, srcRng As Range
lr = Sheets("Index").Cells(Rows.Count, 1).End(xlUp).Row
Set srcRng = Sheets("Index").Range("A2:A" & lr)
For Each sh In ThisWorkbook.Sheets
For Each c In sh.Range("A2:A" & _
Cells(Rows.Count, 1).End(xlUp).Row)
Set i = srcRng.Find(c.Value, LookIn:=xlValues)
If Not i Is Nothing Then
i.Offset(0, 1).Copy c.Offset(0, 1)
End If
Next
Next
End Sub


"Mark P" <Mark wrote in message
...
I have an index spreadsheet that lists a code number for an item in one
column and the name of the item in a different column. I want to use this
information in different spreadsheets that have only the code numbers. Is
it
possible to take a code number in one spreadsheet, search for it in the
index
spreadsheet, copy the corresponding name, and paste the name back into the
spreadsheet that just has the codes?

Thanks!