View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Help my please: VBA code for "Find" function


with sheets("Sheet1")
LastRow = .Range("A" & Rows.Count).end(xlup).Row
ForRowCount = 1 to LastRow
Itm = .Range("A" & RowCount)
with Sheets("Sheet2")
set c = .Columns("A").Find(what:=Itm, _
lookin:=xlvalues, lookat:=xlwhole)
if c is nothing then
msgbox("Could not find : " & itm)
else
'c is the cell with the matched item
end With

Next RowCount
end with


"emil" wrote:

I have two columns in diferent Sheets.

A
1 Acidophilus with Psylium (100 capsule)
2 AC-Zymes (100 capsule)
3 Beta Carotene (100 capsule gelatinoase)
4 Chelated Zinc (100 tablete)
5 Full Spectrum (90 tablete)
Sheet1

A
1 Chelated Zinc (100 tablete)
2 €¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦.
3 Acidophilus with Psylium (100 capsule)
4 €¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦
5
Sheet2


I want to find and select in Sheet2 the content from one or other
Sheet1 cells, using a VBA code. eg: Fiind in Sheet2.Column(A:A) the content
of Sheet1.Range(A4)
Thanks in advance

Emil