If you can't get my code to work, send me a sample workbook and I will see
if I can see what the problem is.
(e-mail address removed)
--
Regards,
Tom Ogilvy
- Show quoted text -
Ok this post is the sub I am using to work this, tested and it works
fine thanks for the help everyone
Sub Front1()
'Day 1
Application.ScreenUpdating = False
'Change cells & txt green & format lines & unprotect sheet
Sheets("back1").Activate
ActiveSheet.Unprotect Password:="123"
Range("I1:J1").Select
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
Selection.Font.ColorIndex = 35
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
If WorksheetFunction.CountBlank(Sheets("back1A").Range("e5:e40")) = 36
Then
Sheets(Array("MDN1", "back1", "front1")).Select
Else
Sheets(Array("MDN1", "back1", "back1a", "front1")).Select
End If
Sheets("front1").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("PrintMenu").Select
'Change cells back again
Sheets("back1").Activate
Range("I1:J1").Select
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 1
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
ActiveSheet.Protect Password:="123"
Range("A5").Select
Sheets("printmenu").Activate
End
Application.ScreenUpdating = True
End Sub