By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

Import Worksheet Name into a Cell

P: 2
What's the easiest way to get the worksheet name into a cell in the worksheet, such that any time the worksheet name is changed, that change is reflected in the cell in the worksheet?

I tried this, but it doesn't work:

Option Explicit
Private Sub Worksheet_Activate()
Dim dayofweek As String
dayofweek = Sheet1.Name
Sheet1.Range("J9") = dayofweek
End Sub
Sep 1 '07 #1
Share this Question
Share on Google+
2 Replies


SammyB
Expert 100+
P: 807
You don't need code, just use
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

However, this will give #VALUE! untill the workbook is saved
Sep 1 '07 #2

P: 2
You don't need code, just use
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

However, this will give #VALUE! untill the workbook is saved
Superb! Thanks SammyB!
Sep 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.