Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
217 views
in Technique[技术] by (71.8m points)

excel - Find an exact match in an excell workbook then copy data from that row to another workbook

I have two excell workbooks (wpt.xls & route.xls) that I'm using to make Waypoint & Route files. I would like to automate the process a bit by using a macro to find the row that contains "A-1" in column F in workbook (wpt.xls) then I would like to paste the data from column A into my other workbook (route.xls) into cell A1. My sheet looks like the one below.

A   B       C       D               E          F
1   1   1   26-41.3143-N    082-52.0707-W   B-2
2   1   1   26-43.1669-N    082-47.6695-W   Z-3
3   1   1   26-49.7169-N    082-53.1127-W   Z-7
4   1   1   26-42.4121-N    082-51.9514-W   A-1

In this example I need "4" to be copied and pasted to my workbook (route.xls) into the the cell A1.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This will work:

=INDEX([wpt.xlsx]Sheet1!$A$1:$A$4,MATCH(A1,[wpt.xlsx]Sheet1!$F$1:$F$4,0))

Enter that on the sheet in your route sheet, at the moment it looks in cell A1 for the item in col F you want.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...