alexisremen
New Member
- Joined
- Nov 15, 2021
- Messages
- 3
- Office Version
- 2016
Hi,
I have this piece of code:
The code seems to work if I refer to any range in MyWorksheet instead of using MYRANGE. What I want is to put a reference to another workbook where it says MYRANGE. That other workbook will be open. Any idea how to do this?
Thanks!
I have this piece of code:
VBA Code:
With Workbooks("MyWorkbook.xlsx").Worksheets("MyWorksheet")
Workbooks("OtherWorkbook.xlsb").Worksheets("OtherWorksheet").Cells(i, "MR").Value2 = _
.Evaluate("SUMPRODUCT((W2:W150000=MYRANGE)*Z2:Z150000,AA2:AA150000)")
End With
The code seems to work if I refer to any range in MyWorksheet instead of using MYRANGE. What I want is to put a reference to another workbook where it says MYRANGE. That other workbook will be open. Any idea how to do this?
Thanks!