View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default How to protect all sheet ?

Adapt this to your needs.

Sub Sheetname_cell()
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
On Error Resume Next
sh.Name = sh.Range("C4").Value
'next lines cover duplicate names

If Err.Number 0 Then
MsgBox "Change the name of : " & sh.Name & " manually"
Err.Clear
End If
On Error GoTo 0

Next
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 3 Aug 2006 12:23:48 -0400, vumian
wrote:


hi man,

ok if it corrects, AND HOW ABOUT THE DUPLICATE NAME OF C4 FOR NAME TO
SHEET.
maybe let's popup msgbox here to info error.

how to do it.

regards