Hi I've created a function (by recording a macro) which will format a nummber of different worksheets,
the function is set up as below
Function formatfile(sheet_name As Worksheet)
Range("E13:AD17").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
blah blah blah
i am calling it by
For Each work_sheet In w.Worksheets
formatfile(work_sheet)
blah blah
however it fails any ideas would be appreciated
the function is set up as below
Function formatfile(sheet_name As Worksheet)
Range("E13:AD17").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
blah blah blah
i am calling it by
For Each work_sheet In w.Worksheets
formatfile(work_sheet)
blah blah
however it fails any ideas would be appreciated