Attribute VB_Name = "WriteStockCode" Option Explicit Function run(row As Integer, content As String) On Error GoTo eh Worksheets(TARGET_SHEET).Range(COL_STOCK_CODE & CStr(row)).Value = content Done: Exit Function eh: Debug.Print "WriteStockCode" Debug.Print row Debug.Print content End Function