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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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