View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Melanie Breden Melanie Breden is offline
external usenet poster
 
Posts: 88
Default VBA and determining which sheet the code is running under

I am calling code that resides within different sheets.
So I start on sheet1 and press a go button the go button calls a
function on sheet2, sheet3 etc. Within the code on sheet2 I need to
grab the name of sheet2. I cannot hard code it as the sheets maybe
renamed and I need the current sheet name. I have tried using
ActiveSheet but this returns sheet1.


is the code in the module of the sheet?
Then use the keyword 'Me' in place of 'ActiveSheet'.

--
Mit freundlichen Grüssen

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)