Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exclude sheets from code
I have a bit of code thats automatically sets borders for new sheets.
When the code runs, it changes the borders on all sheets in the workbook. I would like to have two sheets excluded from this code. The sheet names are "All" and "Tally" Here is my code: Sub Set_Borders() Dim sht As Worksheet For Each sht In ActiveWorkbook.Sheets With sht.Range("A1:An53") .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone .Borders.LineStyle = xlContinuous .Borders.Weight = xlMedium .Borders.ColorIndex = xlAutomatic .Borders(xlInsideVertical).Weight = xlHairline .Borders(xlInsideHorizontal).Weight = xlHairline End With With sht.Range("A1:An1") .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone .Borders.LineStyle = xlContinuous .Borders.Weight = xlMedium .Borders.ColorIndex = xlAutomatic .Borders(xlEdgeBottom).Weight = xlThin .Borders(xlInsideVertical).Weight = xlHairline .Borders(xlInsideHorizontal).Weight = xlHairline End With Next sht Sheets("All").Activate End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Exclude hidden sheets from formatting | Excel Programming | |||
Exclude HTML code | Excel Discussion (Misc queries) | |||
Step through sheets, but exclude one | Excel Programming | |||
Exclude Sheets from Macro | Excel Programming | |||
Edit code - exclude sheets | Excel Programming |