XL 2016 Fonction avec InputBox

Scorpio

XLDnaute Impliqué
Bonjour à tous,
Il y a quelques temps, un gentil membre m'a aidé et je le remercie beaucoup, a concevoir ce code, et j'aimerais faire une correction, mais je ne sais pas ou introduire cette correction.
En fait, il s'agit d'incorporer une information dans le InputBox.
Voici le texte ci-dessus en rouge
Merci de votre aide
A+++
'("Indiquer le nom de la société... ", "Nouveau membre")


'Fonction color les ligne et affiche dans cellule A1
Private Sub Worksheet_BeforeDoubleClick(ByVal c As Range, Cancel As Boolean)
Dim qui As String
Application.ScreenUpdating = False
Cancel = True
On Error Resume Next
If c.Address = "$A$1" Then
qui = InputBox(qui)

If qui = "" Then Exit Sub
With Range("a:p"): .Interior.ColorIndex = xlNone: .AutoFilter Field:=1, Criteria1:=qui: End With
Range("a2:p65000").SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeConstants).Interior.ColorIndex = 4
Range("a2:p65000").SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeFormulas).Interior.ColorIndex = 4
Range("a1") = qui & " : " & Application.Subtotal(3, [a:a]) - 1 & Chr(10) & Application.Subtotal(9, [d:d]) & " CHF"
Cells.AutoFilter
End If
End Sub

'Annuler la fonction
Private Sub Worksheet_BeforeRightClick(ByVal c As Range, Cancel As Boolean)
If c.Address = "$A$1" Then Cancel = True: c = "Sociétés": [a:p].Interior.ColorIndex = xlNone
End Sub
 

JBARBE

XLDnaute Barbatruc
Bonjour à tous,
Peut-être ceci :
qui = InputBox("Indiquer le nom de la société... ", "Nouveau membre")

et
If qui = "" Then
Msgbox " Veuillez Indiquer le nom de la société... "
Exit Sub
end if
Bonne soirée
 

Statistiques des forums

Discussions
312 203
Messages
2 086 196
Membres
103 153
dernier inscrit
SamirN