![]() |
Donot allow user to change name of the worksheet
Hi
I have a workbook with several sheets in it. However I donot want anyone to change name of one worksheet named 'Data'. He can rename other sheets. Is it possible to prevent user from changing name of one sheet? (This is because my macro will delete all sheets except the one with name 'Data'. If user changes name of 'Data' sheet, tehn macro will delete it!) Thank You Pawan |
Donot allow user to change name of the worksheet
Hi,
there's no sheetname_change event but there are several workarounds. One way would be to look at your macro and use codename instead of name. While the codename can be changed its fairly safe and of course you do have a backup don't you. the example below assumes you sheet named "Data" has a codename of sheet1 For Each Worksheet In Sheets 'If worksheet.Name < "Data" Then If Worksheet.CodeName < "Sheet1" Then Worksheet.Delete End If Next Worksheet Mike "Pawan" wrote: Hi I have a workbook with several sheets in it. However I donot want anyone to change name of one worksheet named 'Data'. He can rename other sheets. Is it possible to prevent user from changing name of one sheet? (This is because my macro will delete all sheets except the one with name 'Data'. If user changes name of 'Data' sheet, tehn macro will delete it!) Thank You Pawan |
Donot allow user to change name of the worksheet
It worked...
Thanks Mike.. :) "Mike H" wrote: Hi, there's no sheetname_change event but there are several workarounds. One way would be to look at your macro and use codename instead of name. While the codename can be changed its fairly safe and of course you do have a backup don't you. the example below assumes you sheet named "Data" has a codename of sheet1 For Each Worksheet In Sheets 'If worksheet.Name < "Data" Then If Worksheet.CodeName < "Sheet1" Then Worksheet.Delete End If Next Worksheet Mike "Pawan" wrote: Hi I have a workbook with several sheets in it. However I donot want anyone to change name of one worksheet named 'Data'. He can rename other sheets. Is it possible to prevent user from changing name of one sheet? (This is because my macro will delete all sheets except the one with name 'Data'. If user changes name of 'Data' sheet, tehn macro will delete it!) Thank You Pawan |
All times are GMT +1. The time now is 08:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com