我想使用控制器内部的DB :: table查询从外键中检索数据,但是我收到的错误是:此集合实例上不存在属性[assigned_to]。我已经做了一对多的用户和表之间的反向关系。
Sub Vlook()
Dim LR As Long
Dim Rg2, L As Range
Rg2 = Workbooks("mis").Sheets(1).Range("A2:Z10000")
ThisWorkbook.Sheets(1).Activate
With ActiveSheet
ActiveSheet.Range("a1").Select
LR = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row - 1
.Columns("A:A").EntireColumn.NumberFormat = "0"
.Range("a1").Select
Range("a1").End(xlToRight).Select
Set L = ActiveSheet.Range("A2")
With ActiveCell
.Offset(1, 1).Resize(LR).FormulaR1C1 = "= vlookup( " & L.Address(False, False) & "," & Rg2.Address(True, True, xlR1C1, xlExternal) & ",16,False)"
End With
End With
End Sub