Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Matching values in 1 column to data in another
Backup your workbook before trying this macro you can change the searching text by changing search_text variabl value. try it and let me know Sub Macro1() Dim INIT, I, t, incr, search_text As Variant I = 0 Columns("g:g").Select On Error GoTo a: search_text = "IWEC44332" Selection.Find(What:=search_text, After:=ActiveCell, LookIn:=xlFormula _ , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Activate INIT = ActiveCell.Address Range("h" & ActiveCell.Row).Value = Range("f" & ActiveCell.Row).Value While I = 0 Selection.FindNext(After:=ActiveCell).Activate If ActiveCell.Address = INIT Then I = 1 Else Range("h" & ActiveCell.Row).Value = Range("f" & ActiveCell.Row).Value End If Wend a: If Err.Description < "" Then MsgBox "no match found" End If End Su -- anilsolipura ----------------------------------------------------------------------- anilsolipuram's Profile: http://www.excelforum.com/member.php...fo&userid=1627 View this thread: http://www.excelforum.com/showthread.php?threadid=38030 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MATCHING A VALUE IN A CELL TO A COLUMN OF VALUES IN ANOTHER SHEET | Excel Discussion (Misc queries) | |||
If two criteria match then sum matching values in another column | Excel Worksheet Functions | |||
Display maximum value of matching values in a different column | Excel Discussion (Misc queries) | |||
Select 50 greatest values with column matching | Excel Discussion (Misc queries) | |||
Create worksheets for each matching values in Column? | Excel Programming |