简体   繁体   中英

Search column in one Excel workbook to paste Adjacent Cell's Value into active VBA script

I have Workbook1 and Workbook2 and need to search column A in Workbook1 for specific string value and then copy adjacent cell that is in column B of Workbook1 to the macro being run where I need to insert the value in the following formula in VBA script: =(ROUNDUP((F2+40)/[VALUE],0))*[VALUE]. The [VALUE] = the value taken from the adjacent cell in column B from Workbook1. Workbook2 is where the macro is running on.

I am being rushed at the moment and if this is not clear enough. I will come back and clarify as needed.

VALUE = WorksheetFunction.VLookup(theString, Workbooks("Workbook1").Worksheets("Sheet1").Range("A:B"), 2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM