Private Sub CommandButton1_Click()
'Sub envoiPlageCellules_Excel()
ActiveSheet.Range("A1:d50").Select ' la plage de cellules à envoyer
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.Subject = "Inventaire atelier du " & Sheets("accueil").Range("e1").Value
.Introduction = "bonjour , ci joint: Inventaire F2"
D = ""
For Each ctrl In Me.Controls
Select Case True
Case Not TypeName(ctrl) = "OptionButton"
Case Not ctrl ' non coché
Case D = "": D = ctrl.Caption
Case Else: D = D & ";" & ctrl.Caption
End Select
Next
.Item.To = D
'.Item.Send
End With...
Private Sub CommandButton1_Click()
'Sub envoiPlageCellules_Excel()
ActiveSheet.Range("A1:d50").Select ' la plage de cellules à envoyer
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.Subject = "Inventaire atelier du " & Sheets("accueil").Range("e1").Value
.Introduction = "bonjour , ci joint: Inventaire F2"
D = ""
For Each ctrl In Me.Controls
Select Case True
Case Not TypeName(ctrl) = "OptionButton"
Case Not ctrl ' non coché
Case D = "": D = ctrl.Caption
Case Else: D = D & ";" & ctrl.Caption
End Select
Next
.Item.To = D
'.Item.Send
End With
Unload Me
End Sub
oui, ça bien marché juste après ajoutBonjour,
VB:Private Sub CommandButton1_Click() 'Sub envoiPlageCellules_Excel() ActiveSheet.Range("A1:d50").Select ' la plage de cellules à envoyer ActiveWorkbook.EnvelopeVisible = True With ActiveSheet.MailEnvelope .Item.Subject = "Inventaire atelier du " & Sheets("accueil").Range("e1").Value .Introduction = "bonjour , ci joint: Inventaire F2" D = "" For Each ctrl In Me.Controls Select Case True Case Not TypeName(ctrl) = "OptionButton" Case Not ctrl ' non coché Case D = "": D = ctrl.Caption Case Else: D = D & ";" & ctrl.Caption End Select Next .Item.To = D '.Item.Send End With Unload Me End Sub