I am trying to have a workbook where it is used for pricing projects. The workbook has the ability to price 15 unique project sites. There is a toggle which allows the user to "enable" or "disable" a site based on the particular project being priced. Directly below is the pretty basic toggle which I have programmed to both show and hide the new sites based on the user input.
I would like the user to not only be able to enable or disable sites in column "C", but also to have the ability to change the name of that particular tab name, based on the contents of cell "B" (easier to track which site is being priced when multiple locations are enabled). Below is a short version table which reflects my what I am trying to get across.
<tbody>
</tbody>
So the user can input a site name like "Chicago North" in [B47], and toggle [C47] to "enable". That would unhide the tab, AND rename that tab to "Chicago North".
I am running into issues once the tab name changes because my original code is not updated with the new tab name, which breaks the workbook. Any help / suggestions would be appreciated.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If [C47] = "Disable" Then
Sheets("SITE 2").Visible = False
Else
Sheets("SITE 2").Visible = True
End If
If [C48] = "Disable" Then
Sheets("SITE 3").Visible = False
Else
Sheets("SITE 3").Visible = True
End If
If [C49] = "Disable" Then
Sheets("SITE 4").Visible = False
Else
Sheets("SITE 4").Visible = True
End If
' ...... etc through 15 sites
I would like the user to not only be able to enable or disable sites in column "C", but also to have the ability to change the name of that particular tab name, based on the contents of cell "B" (easier to track which site is being priced when multiple locations are enabled). Below is a short version table which reflects my what I am trying to get across.
Column B | Column C | |
46 | Enter Site Name / Location | Enable Or Disable |
47 | Site #1 | Enable |
48 | Site #2 | Enable |
49 | Site #3 | Disable |
50 | Site #4 | Disable |
<tbody>
</tbody>
So the user can input a site name like "Chicago North" in [B47], and toggle [C47] to "enable". That would unhide the tab, AND rename that tab to "Chicago North".
I am running into issues once the tab name changes because my original code is not updated with the new tab name, which breaks the workbook. Any help / suggestions would be appreciated.