I want to be able to update the sheet name based upon a certain cell value in the corresponding sheet. For example if the Value in in Sheet 1, Cell B3 is "Left Wing" I want the name of Sheet one to say Left Wing. If I change the name to Right wing, I want the sheet to automatically update to Right wing. How can I do this?
seanfoxen,
You would use a Worksheet_Change event. Place this code in the desired Sheet module:
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("B3")) Is Nothing Then Me.Name = Me.Range("B3").Text End Sub
Its important to note that renaming a worksheet this way could cause an invalid worksheet name, which will result in an error.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks