Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Public Sub VlookupClosedWb(Optional strLookFor As String = "Erteilung Baugenehmigung", _
- Optional strSheet As String = "APF", _
- Optional lngColIndex As Long = 2)
- Dim strRange As String
- strRange = "'" & ThisWorkbook.Path & "\[" & strSheet & ".xlsx]" & "Monatsbericht'!$A:$E"
- ActiveCell.Formula = "=VLOOKUP(""" & strLookFor & """," & strRange & "," & lngColIndex & ",0)"
- 'VlookupClosedWb = Evaluate(WorksheetFunction.VLookup(strLookFor, strRange, lngColIndex, 0))
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement