Automatically Rename a Worksheet

Manny74

Board Regular
Joined
May 6, 2016
Messages
124
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello, my worksheet is named Sheet1..
I know how to either double click on the worksheet to rename it or right click on the worksheet...
I tried to create a Macro so that based on the data I have, the worksheet automatically is named E MEMORIAL based on cell B3, but didn't work...Or maybe I am doing it wrong...
Any suggestions on how I can have Sheet1 change to E MEMORIAL once E MEMORIAL has been entered in B3?


1BCDEF
2FACILITY UNITPNAMEIDDISCHARGE
3E MEMORIAL3NJOHN DOE999HOME
4E MEMORIAL3NJANE DOE444REHAB
5E MEMORIAL3NJOSH DOE111SNF
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Paste this into the Sheet1 (Sheet1) Microsoft Excel Objects part

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$3" And Target.Value = "E MEMORIAL" Then
        Name = Target.Value
    End If
End Sub
Snag_1023b23b.png
 
Upvote 0

Forum statistics

Threads
1,215,606
Messages
6,125,811
Members
449,262
Latest member
hideto94

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top