+ Reply to Thread
Results 1 to 5 of 5

Extracting worksheet index

  1. #1
    Ziv
    Guest

    Extracting worksheet index

    I am trying to write a UDF that extract the worksheet index of the cell that
    contains the UDF , similar to ThisCell or Thisworkbook. Any suggestions?

  2. #2
    Rowan
    Guest

    RE: Extracting worksheet index

    How about

    Function thisSheet()
    thisSheet = ActiveSheet.Index
    End Function

    Rowan

    "Ziv" wrote:

    > I am trying to write a UDF that extract the worksheet index of the cell that
    > contains the UDF , similar to ThisCell or Thisworkbook. Any suggestions?


  3. #3
    Rowan
    Guest

    RE: Extracting worksheet index

    Actually scrap that. Doesn't work when the sheet focus changes.

    "Rowan" wrote:

    > How about
    >
    > Function thisSheet()
    > thisSheet = ActiveSheet.Index
    > End Function
    >
    > Rowan
    >
    > "Ziv" wrote:
    >
    > > I am trying to write a UDF that extract the worksheet index of the cell that
    > > contains the UDF , similar to ThisCell or Thisworkbook. Any suggestions?


  4. #4
    Myrna Larson
    Guest

    Re: Extracting worksheet index

    This line should do what the OP requests:

    SheetNumber = Application.Caller.Parent.Index

    On Wed, 23 Mar 2005 17:35:03 -0800, "Rowan" <Rowan@discussions.microsoft.com>
    wrote:

    >How about
    >
    >Function thisSheet()
    > thisSheet = ActiveSheet.Index
    >End Function
    >
    >Rowan
    >
    >"Ziv" wrote:
    >
    >> I am trying to write a UDF that extract the worksheet index of the cell

    that
    >> contains the UDF , similar to ThisCell or Thisworkbook. Any suggestions?



  5. #5
    Bob Phillips
    Guest

    Re: Extracting worksheet index

    You need to be aware that adding/deleting a new does not trigger a recalc,
    so the index doesn't get automatically updated.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Myrna Larson" <anonymous@discussions.microsoft.com> wrote in message
    news:7074419v5j8hhqqiqum0grlhurre3pf0c5@4ax.com...
    > This line should do what the OP requests:
    >
    > SheetNumber = Application.Caller.Parent.Index
    >
    > On Wed, 23 Mar 2005 17:35:03 -0800, "Rowan"

    <Rowan@discussions.microsoft.com>
    > wrote:
    >
    > >How about
    > >
    > >Function thisSheet()
    > > thisSheet = ActiveSheet.Index
    > >End Function
    > >
    > >Rowan
    > >
    > >"Ziv" wrote:
    > >
    > >> I am trying to write a UDF that extract the worksheet index of the cell

    > that
    > >> contains the UDF , similar to ThisCell or Thisworkbook. Any

    suggestions?
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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