XL 2010 Liens hypertexte

tchi456

XLDnaute Occasionnel
Bonjour,

J'ai ce code qui fonctionne très bien pour pouvoir mettre en majuscule les cellules de la colonne A.
Malheureusement la possibilité de créer des liens hypertextes se désactive après reverrouillage de la feuille.

VB:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect Password:="."
Set Target = Intersect(Target, Range("A:A"))
If Target Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Target In Target
If Application.IsText(Target) Then Target = UCase(Target)
Next
Application.EnableEvents = True
ActiveSheet.Protect Password:="."
End Sub

Pouvez-vous m'aider?

Mes meilleures salutations,

Thierry
 
Solution
Je viens de trouver:

VB:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect Password:="."
Set Target = Intersect(Target, Range("A:A"))
If Target Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Target In Target
If Application.IsText(Target) Then Target = UCase(Target)
Next
Application.EnableEvents = True
ActiveSheet.Protect AllowInsertingHyperlinks:=True, Password:="."
End Sub

tchi456

XLDnaute Occasionnel
Je viens de trouver:

VB:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect Password:="."
Set Target = Intersect(Target, Range("A:A"))
If Target Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Target In Target
If Application.IsText(Target) Then Target = UCase(Target)
Next
Application.EnableEvents = True
ActiveSheet.Protect AllowInsertingHyperlinks:=True, Password:="."
End Sub
 

Discussions similaires

  • Résolu(e)
XL 2021 macro
Réponses
9
Affichages
428