Ora però vorrei anche aggiungere che nei range(A3:A17) e (B3:B17) l'iniziale sia maiuscola.
Ho provato a fare come per il codice precedente, ma quando vado a cancellare il contenuto delle caselle nel range mi da errore (run-time 5) e mi evidenzia la stringa:
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A3:A17")) Is Nothing Then
Target(1).Value = UCase(Left(Target(1).Value, 1)) & Right(Target(1).Value, Len(Target(1).Value) - 1) End If
Application.EnableEvents = True
Come faccio?
Questo è quello che ho scritto:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim area As Range
Set area = Me.Range("D1")
If Not Intersect(Target, area) Is Nothing Then
If Range("D1") = "" Then
Range("D1:F1") = "Nome Istruttore"
End If
Set area = Nothing
End If
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("D1:F1")) Is Nothing Then
Target(1).Value = UCase(Left(Target(1).Value, 1)) & Right(Target(1).Value, Len(Target(1).Value) - 1)
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A3:A17")) Is Nothing Then
Target(1).Value = UCase(Left(Target(1).Value, 1)) & Right(Target(1).Value, Len(Target(1).Value) - 1)
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("B3:B17")) Is Nothing Then
Target(1).Value = UCase(Left(Target(1).Value, 1)) & Right(Target(1).Value, Len(Target(1).Value) - 1)
End If
Application.EnableEvents = True
End Sub
Mi sa che ho fatto un po di casino
[Modificato da smichel 28/10/2012 12:46]
Excel 2003 Professional