1
vlookupで列インデックスno d
を呼び出す方法"=vlookup(RC[-15],"& Rg.Address(True, True, xlR1C1, xlExternal) & ",d,False)"
は正しいですか? (別のワークブックに1つのワークブックを使用してVLOOKUPに注意してください)Vlookupで列インデックス番号を呼び出す方法:VBA
Sub Vlkuprangcall()
Dim strColumn As String
Dim Rg As Range
Dim wb2 As Workbook
Dim d, a, Lastrow As Long
Set wb2 = Workbooks.Open("C:\Users\ashokkumar.d\Desktop\Test\IC Raphael\Janalakshmi\MIS\MIS.xlsx")
Set Rg = wb2.Sheets(3).Range("A3:Z10000")
d = 6
Application.Workbooks(2).Activate
With ActiveSheet
a = ActiveCell.Column
Lastrow = 100
strColumn = Split(ActiveCell.Address, "$")(1)
ActiveCell.FormulaR1C1 = "=vlookup(RC[-15],"& Rg.Address(True, True, xlR1C1, xlExternal) & ",d,False)"
ActiveCell.AutoFill Destination:=Range(ActiveCell, Range(strColumn & Lastrow))
End With
End Sub