Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Run a macro when sheet name changes

I need to run a macro when sheet name changes.. how to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Run a macro when sheet name changes

hi
so far as i know, there is no sheet name change event to trigger a macro to
run.
what are we trying to do?

regards
FSt1

"Kash" wrote:

I need to run a macro when sheet name changes.. how to do this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Run a macro when sheet name changes

Do you mean when a user actually changes the name of a worksheet or when a
user selects a different worksheet.

If the former then I don't think there is an event associated with it.

If the latter then in the VBA editor on the left side there is the project
explorer.
Double click ThisWorkbook.

At the top of the section where the code goes there are 2 drop down boxes.
Click the DropDown arrow of the box on the left.
Click the dropdown of the box on the right.
Select either SheetActivate or SheetDeactivate.

The sub name and end sub will be created.

When writing the code, sh is the sheet that was either activated or
deactivated depending on which sub you use.
Example:
msgbox sh.Name 'Returns the sheet name

--
Regards,

OssieMac


"Kash" wrote:

I need to run a macro when sheet name changes.. how to do this?

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
Macro to lookup a sheet, number, then display in origonal sheet abbsy3 New Users to Excel 3 November 9th 10 12:19 PM
Help to code Macro to Copy fron one sheet and paste in other sheet kay Excel Programming 3 July 25th 08 06:46 PM
Return to Current Sheet in On (sheet activate) event macro Paul Moles Excel Programming 1 March 27th 05 03:16 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM


All times are GMT +1. The time now is 02:29 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"