ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   matching and finding data (https://www.excelbanter.com/excel-programming/433345-matching-finding-data.html)

Lynn[_7_]

matching and finding data
 
hi,

how do i match columnA in spreadsheetA with columnB in spreadsheetB to
find the value in columnD of spreadsheetB ?

joel

matching and finding data
 
this code put the results in column B of spreadsheetA

set shtA = sheets("spreadsheetA")
set shtB = sheets("spreadsheetB")
RowCount = 1
with ShtA
Do while .range("A" & Rowcount) < ""
Data = .range("A" & Rowcount)
Set c = ShtB.Columns("B").find(What:=Data, _
lookin:=xlvalues, lookat:=xlwhole)
if not c is nothing then
.Range("B" & RowCount) = c.offset(0,2)
end if

RowCount = RowCount + 1
loop

end with

"Lynn" wrote:

hi,

how do i match columnA in spreadsheetA with columnB in spreadsheetB to
find the value in columnD of spreadsheetB ?



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

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