Ciao TORICAL,
Mi sono espresso male.
Mi riferivo al testo delle Macro VBA che ho copiato e incollato in precedenza.
Puoi cortesemente inserire quel tuo suggerimento nel testo VBA che ho incollato in modo tale che possa copiarlo e incollarlo direttamente ?
Prova:
Option Explicit
Sub ResetSpreadsheet()
Const sPassword As String = "Pippo"
On Error GoTo XIT
ActiveSheet.Unprotect Password:=sPassword
Range("B4", "B300").ClearContents
Columns("B:B").HorizontalAlignment = xlCenter
Range("B4", "B512").Font.Bold = True
Range("DD14").Value = 1#
Range("DD9").Value = 3
Range("DD10").Value = 0.5
Range("DD11").Value = -50000
XIT:
ActiveSheet.Protect Password:=sPassword
End Sub
Sub macro_a()
Dim uriga As Long
Const sPassword As String = "Pippo"
On Error GoTo XIT
ActiveSheet.Unprotect Password:=sPassword
uriga = Range("B" & Rows.Count).End(xlUp).Row + 1
If uriga = 2 Then
Range("B5") = "B"
Range("B5").Select
Else
Range("B" & uriga) = "B"
Range("B" & uriga).Select
End If
With Selection.Font
.Color = -16776961
.Name = "Tw Cen MT"
.Size = 16
End With
XIT:
ActiveSheet.Protect Password:=sPassword
End Sub
Sub macro_b()
Dim uriga As Long
Const sPassword As String = "Pippo"
On Error GoTo XIT
ActiveSheet.Unprotect Password:=sPassword
uriga = Range("B" & Rows.Count).End(xlUp).Row + 1
If uriga = 2 Then
Range("B5") = "P"
Range("B5").Select
Else
Range("B" & uriga) = "P"
Range("B" & uriga).Select
End If
With Selection.Font
.Color = -16776961
.Name = "Tw Cen MT"
.Size = 16
End With
XIT:
ActiveSheet.Protect Password:=sPassword
End Sub
===
Regards,
Norman
