Using Find to Cut & Paste
Sub getdata()
With Sheets("Summary")
RowCount = 1
Do While .Range("A" & RowCount) < ""
ID = .Range("A" & RowCount)
With Sheets("Data")
Set c = .Columns("A").Find(what:=ID, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
MsgBox ("Did not find ID : " & ID)
Else
Data = c.Offset(rowoffset:=0, columnoffset:=1)
End If
End With
If Not c Is Nothing Then
.Range("B" & RowCount) = Data
End If
Loop
End With
End Sub
"Mark P" wrote:
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!
|