+ Reply to Thread
Results 1 to 9 of 9

Name Worksheet based on cell value

  1. #1
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Name Worksheet based on cell value

    Hi all,

    I want to name all my sheets in my workbook based on the value in cell B1 on each sheet

    I found a code on MSDN but for the life of me i cant get it to run, no idea what i am doing wrong. I am new enough to vba, but i am filling in all the areas with my cells but no joy.

    Please Login or Register  to view this content.
    Any help be great as i have 60 sheets to name

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Name Worksheet based on cell value

    Thats using A1

    Please Login or Register  to view this content.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Name Worksheet based on cell value

    Yes but even it i change it to

    Please Login or Register  to view this content.
    It returns the error "Object Required"

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Name Worksheet based on cell value

    Where are you putting the code?

    Have you changed it at all?

    When do you want the sheets to be named?
    If posting code please use code tags, see here.

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Name Worksheet based on cell value

    Where does it error?

  6. #6
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Name Worksheet based on cell value

    I am putting the code into its own Module

    I have only changed the reference of the cell value to the cell I want - "$B$1"

    I want it to name the sheet when i run the code

  7. #7
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Name Worksheet based on cell value

    Why have you used Private Sub Worksheet_Change(ByVal Target As Range) then?

  8. #8
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Name Worksheet based on cell value

    So I had just googled that code, and got it off MSDN but most of it was unnecessary.

    I have found a much easier code to work with

    Please Login or Register  to view this content.
    This will do for me.

    Thanks for your help

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Name Worksheet based on cell value

    Simon

    Are you sure that's all you changed?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy data from a copied worksheet to another worksheet based on cell reference
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2013, 02:18 PM
  2. Macro to select worksheet based on cell value and then return data to diff worksheet
    By clnossok in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2013, 07:48 PM
  3. Replies: 4
    Last Post: 10-30-2012, 06:15 PM
  4. [SOLVED] Copy rows from my main worksheet to another worksheet based on data in one cell
    By gcol in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-08-2012, 05:12 AM
  5. [SOLVED] Change Autoshape Color in one worksheet based on cell value in a different worksheet
    By Vigny Mathew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2012, 11:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1