This macro is just a vlookup. It is supposed to run column A in SITELIST_MACRO against column A in the file the user is prompted to open. Running into an error at the vLookup line. "application-defined or object-defined error"
I am currently at the following code:
Sub vlookup_only()
' vlookup_only Macro '
' Keyboard Shortcut: Ctrl+Shift+V
' Dim myFileName, SITELIST_Macro As Workbook
myFileName = Application.GetOpenFilename
If myFileName <> False Then
With Range("A:A")
Set wbLookupBook = Workbooks.Open(myFileName)
ActiveCell.FormulaR1C1 = "=VLOOKUP(C[-2],[ myFileName.Name]Sites!C1,1,FALSE)"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C10000")
Range("C2:C10000").Select
End With
wbLookupBook.Close False
End If
End Sub
Bookmarks