Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MATCHING A VALUE IN A CELL TO A COLUMN OF VALUES IN ANOTHER SHEET carrach Excel Discussion (Misc queries) 3 February 6th 10 04:32 PM
If two criteria match then sum matching values in another column Diddy Excel Worksheet Functions 5 February 25th 09 06:03 PM
Display maximum value of matching values in a different column Mally Excel Discussion (Misc queries) 7 July 11th 08 03:17 PM
Select 50 greatest values with column matching [email protected] Excel Discussion (Misc queries) 2 November 24th 06 09:14 AM
Create worksheets for each matching values in Column? Kobayashi[_35_] Excel Programming 7 June 2nd 04 07:10 AM


All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"