PDA

View Full Version : move worksheet to end



wilg
01-05-2011, 09:07 PM
Would like to know how to move the sheet if it turns red to the end of all my sheets. The name of my sheets are populated from a list on another worksheet




Private Sub Worksheet_Calculate()
If Range("as1") = "n" Then
Me.Tab.ColorIndex = 3 ' blue
Else
Me.Tab.ColorIndex = 5 ' red

End If
End Sub

Simon Lloyd
01-05-2011, 09:26 PM
Try this:
If Range("as1") = "n" Then
Me.Tab.ColorIndex = 5 ' blue
Else
Me.Tab.ColorIndex = 3 ' red
Me.Move After:=Sheets(Sheets.Count)
End If