Option Compare Database Public Function format(filepath, sheetname) Set xls = CreateObject("EXCEL.APPLICATION") xls.screenupdating = False xls.displayalerts = False xls.Visible = True xls.workbooks.Open filepath Set xlsdd = xls.activeworkbook xls.range("1:1").select With xls.selection.Font .Bold = True .Name = "Arial" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False End With xls.sheets(sheetname).cells.Columns.autofit xls.CutCopyMode = False With xlsdd .Save .Close End With xls.Visible = False Set xlsdd = Nothing Set xls = Nothing End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)