Using Sheet Name In Cells

R

Rafael Ortiz

Open the VBA editor (Alt + F11), insert a blank VBA module (Insert, Module),
then copy and paste the following lines of code into the blank module:

Sub NameCell()
ActiveCell.Value = ActiveSheet.Name
End Sub

Sub NameSheet()
ActiveSheet.Name = [A1].Value
End Sub

Now return to the worksheet area. Click on any blank cell. Hit Alt + F8, and
select and run the macro called "NameCell." Thns places the name of your
sheet into whatever cell you have selected. Manually change the sheet name
and do this again.

Now go to cell A1 and type in a valid sheet name. Hit Alt + F8 again, and
select and run NameSheet. You should see that the sheet's name changed to
the contents of cell A1.

MRO





From: "Paul Moles" <[email protected]>
Subject: Using Sheet Name In Cells
Date: Wednesday, September 17, 2003 7:27 AM

In Excel Xp how do I get a cell to show the sheet
name,alternatively can I get the sheet name to show the
contents of a cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top