+ Reply to Thread
Results 1 to 5 of 5

Tabname function not dynamic

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Lytham St Annes, UK
    MS-Off Ver
    various
    Posts
    3

    Tabname function not dynamic

    I created a simple function as follows:

    Public Function TabName() as string
    TabName = ActiveSheet.Name
    End Function


    This works as I would expect, except it doesn't update when the worksheet tab name is changed - the only way to get it to update is to enter-then-exit edit-mode in the cell containing =TabName()

    Can anyone explain why this is, and what I can do to make it more dynamic?

    Thanks

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,877

    Re: Tabname function not dynamic

    Try this -

    Please Login or Register  to view this content.
    Last edited by NeedForExcel; 07-01-2015 at 06:56 AM.
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    07-01-2015
    Location
    Lytham St Annes, UK
    MS-Off Ver
    various
    Posts
    3

    Re: Tabname function not dynamic

    Thanks - that worked perfectly.

    The Help on this method states that True is the default - but this experience suggests otherwise.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Tabname function not dynamic

    @ NeedForExcel
    I tested the UDF function and created three sheets (Main - Data - Report) and in Cell A1 in each sheet I put the formula
    Please Login or Register  to view this content.
    When I'm in Main sheet it's ok, but when navigate to Data sheet or Report sheet I found the cell A1 still appears "Main" and I have to double click any cell to refresh results..
    Hope it is clear
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  5. #5
    Registered User
    Join Date
    07-01-2015
    Location
    Lytham St Annes, UK
    MS-Off Ver
    various
    Posts
    3

    Re: Tabname function not dynamic

    Yes - I got that, but I just added a "Calculate" in the Workbook_SheetActivate sub.

    I suppose it might be an issue if calculations in one sheet were based on those from another, but in my case this isn't going to be a problem.

+ 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. Summarize - Several Criterias + tabname question
    By David007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-02-2011, 06:18 PM
  2. Enter tabname and info from one cell into another
    By raehippychick in forum Excel General
    Replies: 3
    Last Post: 08-23-2007, 09:09 AM
  3. Compiling TabName on one Sheet?
    By Petitboeuf in forum Excel General
    Replies: 2
    Last Post: 01-11-2007, 01:27 PM
  4. Tabname Changes
    By Big Rick in forum Excel General
    Replies: 2
    Last Post: 03-02-2006, 01:35 PM
  5. Retreiving TABNAME from within a spreadsheet
    By Bob Harike in forum Excel General
    Replies: 2
    Last Post: 02-02-2005, 06:06 PM

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