Ciao queste 2 macro allegate:
Sub rename_Sheet
Sub rename_Sheet_dopo_reset
Option Explicit
Sub rename_Sheet()
Dim OldName As String
Dim avviso, rese As String
ActiveWorkbook.Unprotect "123456"
OldName = ActiveSheet.Name
On Error Resume Next
Application.ScreenUpdating = False
rese = ActiveSheet.Range("R12").Value
avviso = MsgBox("Sign. " & Environ("UserName") & " rinomino il foglio in < " & rese & " > ?", _
vbExclamation + vbYesNo + vbDefaultButton2, "AVVISO")
If avviso = 7 Then Exit Sub
ActiveSheet.Name = ActiveSheet.Range("R12").Value
On Error GoTo 0
If OldName = ActiveSheet.Name Then
avviso = MsgBox("Sign. " & Environ("UserName") & " il foglio è già stato rinominato, " & Chr(13) & "o nome ripetuto o inserito carattere non valido!", _
vbExclamation, "AVVISO")
If avviso = 7 Then Exit Sub
End If
ActiveWorkbook.Protect "123456"
End Sub
Sub rename_Sheet_dopo_reset()
'tutto il foglio
Dim OldName As String
Dim avviso As String
ActiveWorkbook.Unprotect "123456"
OldName = ActiveSheet.Name
On Error Resume Next
ActiveSheet.Name = ActiveSheet.Range("U13").Value
On Error GoTo 0
If OldName = ActiveSheet.Name Then
End If
ActiveWorkbook.Protect "123456"
End Sub
cambiano il nome ai fogli.
Chiedo un aiuto per:
aggiungere a < Sub rename_Sheet > "colorare il foglio secondo il colore inserito nella cella U14"
aggiungere a < rename_Sheet_dopo_reset > "togliere il colore al foglio"
Spero di essermi spiegato.
Un grazie in anticipo.
john
---------------
excel 2007