mykulpasskwa
Board Regular
- Joined
- Mar 20, 2018
- Messages
- 66
Hi all. People have been super helpful so far helping me with this project I'm working on, but I have one more issue.
I have 5 worksheets and the first one is a dashboard calculator of sorts called "Calc". I have a checkbox that when toggled changes the tab name on four other worksheets in their respective G9 cell. The problem is that in order to actually change the tab name you have to click on each worksheet individually and then change the active cell and then it updates to the new name.
I'm wondering if there is way that when the macro runs it automatically selects a new cell in each workbook but returns to the dashboard or if there is a way to refresh the workbook after the macro runs? Below is a sample of the code that changes the name of the cell.
Any help is greatly appreciated!
I have 5 worksheets and the first one is a dashboard calculator of sorts called "Calc". I have a checkbox that when toggled changes the tab name on four other worksheets in their respective G9 cell. The problem is that in order to actually change the tab name you have to click on each worksheet individually and then change the active cell and then it updates to the new name.
I'm wondering if there is way that when the macro runs it automatically selects a new cell in each workbook but returns to the dashboard or if there is a way to refresh the workbook after the macro runs? Below is a sample of the code that changes the name of the cell.
Any help is greatly appreciated!
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Set Target = Range("G9")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = Left(Target, 31)
Exit Sub
Badname:
MsgBox "Please revise the entry in G9." & Chr(13) _
& "It appears to contain one or more " & Chr(13) _
& "illegal characters." & Chr(13)
Worksheets("Fall").Range("E12").Activate
ActiveSheet.EnableCalculation = False
ActiveSheet.EnableCalculation = True
End Sub
Last edited by a moderator: