LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lookup or Index or Match, not sure.


Sub FindMatch(Target As Range)
Const StartCell As String = "B6"
Dim SearchVal
Dim cell As Range
Dim i As Long
Dim FirstAddress As String

If Not Target.Address = "$B$1" Then Exit Sub
Application.ScreenUpdating = False
SearchVal = Range("B1").Text
With Worksheets("Data Entry").Range("A:A")
Set cell = .Find(SearchVal, LookIn:=xlValues)
If Not cell Is Nothing Then
FirstAddress = cell.Address
Do
cell.Resize(1, 10).Copy Range(StartCell).Offset(i, 0)
i = i + 1
Set cell = .FindNext(cell)
Loop While Not cell Is Nothing And cell.Address < FirstAddress
End If
End With

Application.ScreenUpdating = True
End Sub





Bob Phillips Wrote:
If you post the code that you have now that moves all the correct data
I
will add the clear.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ForSale" wrot
in
message ...

Bob,
With your code I have figured out how to move all of the cells tha

I
need. I am still having trouble clearing sheet2 before running
FindMatch. I have named the range that needs to be cleared 'field'.

Any ideas?

Thanks.


--
ForSale


------------------------------------------------------------------------
ForSale's Profile:

http://www.excelforum.com/member.php...o&userid=11896
View this thread

http://www.excelforum.com/showthread...hreadid=549232


--
ForSal
-----------------------------------------------------------------------
ForSale's Profile: http://www.excelforum.com/member.php...fo&userid=1189
View this thread: http://www.excelforum.com/showthread.php?threadid=54923

 
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
Lookup / Index/Match Joe Excel Worksheet Functions 3 February 11th 10 01:12 PM
Match or Index or Lookup??? Qld Help.. New Users to Excel 4 July 21st 08 10:45 PM
Lookup, index, match? Kikuchisawa Excel Worksheet Functions 1 March 10th 08 09:14 PM
LOOKUP, MATCH, INDEX? bob Excel Worksheet Functions 13 June 6th 07 04:26 AM
lookup/index/match - help! Ellen G. Excel Discussion (Misc queries) 3 February 13th 06 09:10 PM


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

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

About Us

"It's about Microsoft Excel"