ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help my please: VBA code for "Find" function (https://www.excelbanter.com/excel-programming/428236-help-my-please-vba-code-find-function.html)

emil

Help my please: VBA code for "Find" function
 
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


joel

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


emil

Help my please: VBA code for "Find" function
 
Thank you very, very, very much
Emil
"joel" wrote:


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



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com