joelmathew
New Member
- Joined
- Mar 5, 2015
- Messages
- 35
hi All,
Thanks for reading this. i am a low macro user who wouldnt have a job without everyone here. so thank you!
I need a tabsheet to change its label every time when certian value ( L8 in the "dashboard" tab ) cell changes.
There are two tabs in the spreadsheet- "dashboard" and the sheet the name needs to change". changes made in L8 in the dashboard should automically change the name of 2nd sheet.
the 2nd sheet is called "PY 2018(19) risk details" ( yay the macro works) but it only works after i click ON the 2nd sheet.
I know the macro is working but i want it to work in Real time- Ie - i want it to change the tab name of the second sheet without me having to click it.
Can this be automated? the macro is currently pasted the in the "PY 2018(19) risk details tab" is
Private Sub Worksheet_Activate()
Call Worksheet_activate_part1
End Sub
Private Sub Workbook_SheetChange(ByVal Target As Range)
ActiveSheet.EnableCalculation = True
Call Worksheet_activate_part1
End Sub
Private Sub Worksheet_activate_part1()
Set Target = Worksheets("dashboard").Range("l8")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = Left(Target, 31)
Exit Sub
Badname:
MsgBox "Please revise the entry in L8." & Chr(13) _
& "It appears to contain one or more " & Chr(13) _
& "illegal characters." & Chr(13)
Range("A1").Activate
End Sub
Thanks for reading this. i am a low macro user who wouldnt have a job without everyone here. so thank you!
I need a tabsheet to change its label every time when certian value ( L8 in the "dashboard" tab ) cell changes.
There are two tabs in the spreadsheet- "dashboard" and the sheet the name needs to change". changes made in L8 in the dashboard should automically change the name of 2nd sheet.
the 2nd sheet is called "PY 2018(19) risk details" ( yay the macro works) but it only works after i click ON the 2nd sheet.
I know the macro is working but i want it to work in Real time- Ie - i want it to change the tab name of the second sheet without me having to click it.
Can this be automated? the macro is currently pasted the in the "PY 2018(19) risk details tab" is
Private Sub Worksheet_Activate()
Call Worksheet_activate_part1
End Sub
Private Sub Workbook_SheetChange(ByVal Target As Range)
ActiveSheet.EnableCalculation = True
Call Worksheet_activate_part1
End Sub
Private Sub Worksheet_activate_part1()
Set Target = Worksheets("dashboard").Range("l8")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = Left(Target, 31)
Exit Sub
Badname:
MsgBox "Please revise the entry in L8." & Chr(13) _
& "It appears to contain one or more " & Chr(13) _
& "illegal characters." & Chr(13)
Range("A1").Activate
End Sub