473,409 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Import Worksheet Name into a Cell

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
2 1210
SammyB
807 Expert 512MB
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
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

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

Similar topics

0
by: Dayron | last post by:
Hi, I would like export the records retrieved from database to excel worksheets. unfortunately, each worksheet will support until 65535 records and I have about 1 million of records to write. So I...
8
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a...
2
by: google | last post by:
Is there anyway to programatically confirm that specific field names exist in the first row of a given Excel spreadsheet from code within Access? I have code set up to import data from our...
5
by: hmiller | last post by:
Hey there folks: I have been trying to get this work for about a week now. I'm new to VBA... I am trying to transfer a populated table in Access to an existing, but blank, Excel worksheet. I...
4
by: Alamo | last post by:
Hi, all. I am new to all this. Played in xl some, enjoyed it. still playing. I want to enter text into 2 adjacent cells in one worksheet, then copy a template worksheet and name it the 2-cell text...
1
by: bbasberg | last post by:
Hello, I am wondering how to "carry over" a value from a listbox on one worksheet in the workbook to a cell in another worksheet in the same workbook. For example, to just copy over a value...
1
by: baling | last post by:
Hi.... Hi everybody, i have a code that i make in VBA and know I want to use this code in to VB6. But i don't know how to use that code in to VB 6.0 Please correct this code so i can use it in VB...
1
by: DThreadgill | last post by:
I have a spreadsheet with about 35 tabs that I need to import into one table in Access. I found this link http://www.thescripts.com/forum/thread650662-import+multiple+tabs.html and changed some...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.