Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ziv ziv is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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"
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
This line should do what the OP requests:

SheetNumber = Application.Caller.Parent.Index

On Wed, 23 Mar 2005 17:35:03 -0800, "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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting data from one worksheet to another? onedub Excel Discussion (Misc queries) 0 March 5th 08 02:47 PM
Extracting data into another worksheet louiscourtney Excel Discussion (Misc queries) 9 July 20th 07 12:18 PM
Extracting data from large worksheet Louise Excel Worksheet Functions 4 April 27th 07 03:17 PM
Extracting worksheet names.... johnT Excel Worksheet Functions 5 April 4th 05 02:39 PM
resequence worksheet index after deletion of worksheet tango Excel Programming 2 November 29th 04 11:23 AM


All times are GMT +1. The time now is 05:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"