1. Welcome to the forums
2. Take a minute to read the FAQs and some other suggestions in my sig
3. I added CODE tags to your post -- you can use the [#] icon to enter them and just paste your macro between to set it off and to format it nicely
4. Try this
Option Explicit
Function Return2018(DateValues As Range, TheYear As Long)
Dim This3112 As Double
Dim Last3112 As Double
With Application.WorksheetFunction
This3112 = .VLookup(CLng(DateSerial(TheYear, 12 + 1, 0)), DateValues, 2)
Last3112 = .VLookup(CLng(DateSerial(TheYear - 1, 12 + 1, 0)), DateValues, 2)
Return2018 = This3112 / Last3112
End With
End Function
Sub test()
MsgBox Return2018(ActiveSheet.Range("A1:B788"), 2018)
End Sub