We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
How to make Sheet1 the same as a Cell in Excel
Options

Robj241
Posts: 29 Forumite


in Techie Stuff
Hi,
I have a spreadsheet on Excel and I am wanting it to copy the cell information ie a date - 01.01.18 to replace the Sheet tab at the bottom.
Example
Cell E4 '01.01.18' needs to make sheet1 read '01.01.18'
Many thanks for any help.
I have a spreadsheet on Excel and I am wanting it to copy the cell information ie a date - 01.01.18 to replace the Sheet tab at the bottom.
Example
Cell E4 '01.01.18' needs to make sheet1 read '01.01.18'
Many thanks for any help.
0
Comments
-
You can do it via VBA.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Target = Range("E4")
If Target = "" Then Exit Sub
Application.ActiveSheet.Name = VBA.Left(Target, 31)
Exit Sub
End Sub0 -
It's been a long time since I've done any VBA, but ... why the 2nd Exit Sub? Doesn't End Sub do the same thing?0
-
Thanks for the info.
So do I highlight the cell E3
Click on Macro - Visual Basic Editor
Click the drop down menu and select Worksheet
Type in the info provided
Then save?
Many thanks0 -
...or just right-click on the tab you want, and select "rename" ?......Gettin' There, Wherever There is......
I have a dodgy "i" key, so ignore spelling errors due to "i" issues, ...I blame Apple0 -
Thing is you need some sort of event to trigger the renaming and If you are happy to right click then just
Right Click Cell/Copy
Right Click Tab/Rename/CTRL+V
The problem with the macro is that it renames the Tab EVERY TIME you select a cell (event trigger) for ever and ever amenIf I ruled the world.......0 -
Thanks for the info.
So do I highlight the cell E3
Click on Macro - Visual Basic Editor
Click the drop down menu and select Worksheet
Type in the info provided
Then save?
Many thanks0 -
Unfortunately this comes up as an error.
The Cell E3 contains a date - 01/01/18 but it won't allow /
Is there a way round this?
Many thanks for your assistance.0 -
If you don't want the code to run every time you change cells (which will be annoying) then try this:-
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$4" Then
Application.ActiveSheet.Name = VBA.Left(Target, 31)
End If
End Sub
It will fire every time you change a cell but won't do anything unless you're in cell E4.:wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:
Any posts are my opinion and only that. Please read at your own risk.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.6K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards