for lnI = 1 to m.lnCols .Cells(1,laFieldNames[m.lnI,3]).value = laFieldNames[m.lnI,1] .columns[m.lnI].EntireColumn.autofit() *!* if ' date ' $ " " + lower(laFieldNames[m.lnI,2]) + " " && date field *!* loRange = .UsedRange.Offset(2) && we don't want to apply format for header row *!* loRange.columns[m.lnI].NumberFormat = "mm/dd/yyyy" *!* endif try ** To make sure long descriptions fit if .columns[m.lnI].columnwidth > 15 .columns[m.lnI].columnwidth = 240 else .columns[m.lnI].columnwidth = 15 endif catch to loRangeProblem * Let's ignore this error with the range and column width lcMsg = Log_Error(m.loRangeProblem) endtry next