Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Excelで特定のデータを検索し、関連情報をワードフィールドにコピーする必要があります。
1)キーはWordフィールドの1つ(「primaryID」など)に保存されます。
2)ExcelにはprimaryID列があります
WordでExcelオブジェクトライブラリ参照を使用しています。Excelでデータを「VLOOKUP」してWordにコピーする方法はありますか?代替案はありますか?
範囲オブジェクトのfindメソッドを試しましたか?MS VBAヘルプによると、「情報が見つかった最初のセルを表すRangeオブジェクトを返します」。
IDが一意であると仮定して、VBAを使用して行番号を取得するには:
workbook.WorkSheets(sheetName).Columns(primaryID_Column).Find(ID_to_find).Row