Attribute VB_Name = "Write_250DayMovingAverage" Option Explicit Function run(row as integer, content as string) On Error GoTo eh Worksheets(TARGET_SHEET).Range(COL_250_DAY_MOVING_AVERAGE & CStr(row)).Value = content Done: exit Function eh: debug.print "Write_250DayMovingAverage" debug.print row debug.print content End Function