Comment dire ... ?

Nicko

XLDnaute Occasionnel
Bonjour à tous,

voici un code que j'utilise :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim TheFullPath As String
Dim doc As String

If ActiveCell.Column >= 2 Then Exit Sub
If ActiveCell.Row = 1 Then Exit Sub
If ActiveCell.Value = "" Then Exit Sub

doc = ActiveCell.Value

TheFullPath = "C:\Documents and Settings\Planète Bloc\Mes documents\factures\" & doc & ".pdf"
ThisWorkbook.FollowHyperlink TheFullPath, NewWindow:=True
End Sub

J'aimerais maintenant faire en sorte que lorsque l'on clique sur un numero de ligne, il ne se passe rien !

Comment faire ?

Merci de votre aide

Nicko
 

Banzai64

XLDnaute Accro
Re : Comment dire ... ?

Bonsoir

Essayes

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim TheFullPath As String
  If Target.Count > 1 Or Target.Column > 1 Or Target.Row = 1 Then Exit Sub
  If Target.Value <> "" Then
    TheFullPath = "C:\Documents and Settings\Planète Bloc\Mes documents\factures\" & Target.Value & ".pdf"
    ThisWorkbook.FollowHyperlink TheFullPath, NewWindow:=True
  End If
End Sub
 

Statistiques des forums

Discussions
312 415
Messages
2 088 237
Membres
103 779
dernier inscrit
FrancoisB2