Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: matching two lists in Excel

Status
Not open for further replies.

Cartwheel

Technical User
Mar 14, 2002
13
US
I am trying to match a list with another list. They both have the same values but in a different order. I am having a problem with the find command, it keeps finding and matching the same text 'ABCD' as opposed to matching the string in the next cell 'ABCD'. 'EFGH', 'IJKL'. How do I assign a value for a cell as a string that varies? My attempt is as follows:

Sub Matching3()
'
' Matching3 Macro
' Macro recorded 3/15/2002 by Dr. Vincent W.Yang
'

'
ActiveCell.Offset(1, 1).Range("A1").Select
Selection.Copy
Cells.Find(What:="ABCD", After:=ActiveCell, LookIn _
:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False).Activate
ActiveCell.Offset(0, -1).Range("A1:B1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.LargeScroll Down:=-1
Range("E30").Select
ActiveSheet.Paste
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top