Olivia
Février 14, 2019, 7:37
1
Bonjour à tous,
Je voudrais améliorer mon fichier ci-joint, il comporte quatre feuille (Saisie, formulaire, récapitulatif et base de données) et je souhaiterais:
Insérer un bouton imprimer dans la feuille saisie
(je voudrais, à partir du bouton imprimer placé dans la feuille de saisie puisse imprimer la feuille formulaire suite à la saisie)
Un deuxième bouton pour enregistrer la saisie dans le récapitulatif et remise des cases à vides pour une nouvelle saisie.
Merci à tous pour votre aide
Saisie CR.V2.xlsx (32,3 Ko)
Bonjour,
Pourquoi mettre deux boutons?
Un seul suffit, avec une demande d’impression Oui ou NON
J’attend la réponse avant de monter la macro
Olivia
Février 14, 2019, 8:02
3
Bonjour Mimimathy,
Je suis ta proposition avec la demande d’impression en plus.
Merci
Re
A tester
LA MACRO:
Private Sub CommandButton1_Click()
'********************************
'* DECLARATIONS DES VARIABLES *
'********************************
Dim i%, j%, Dl%, Dc%
Dim Ws As Worksheet, Wd As Worksheet, Wr As Worksheet
'********************************
'* INITIALISATION DES VARIABLES *
'********************************
Set Ws = Sheets("Saisie")
Set Wd = Sheets("Formulaire")
Set Wr = Sheets("Recap")
Dl = Wr.Range("A" & Rows.Count).End(xlUp).Row + 1
'********************************
'* RENSEIGNEMENT FORMULAIRE *
'********************************
Wd.Range("C27").Value = VBA.UCase(Ws.Range("B10").Value) 'Nom
Wd.Range("C29").Value = Application.WorksheetFunction.Proper(Ws.Range("D10").Value) 'Prénoms
Wd.Range("C31").Value = VBA.Format(Ws.Range("G10").Value, "d mmmm yyyy") & " à " & VBA.UCase(Ws.Range("I10").Value) 'D. & L. Naiss
Wd.Range("C33").Value = VBA.UCase(Ws.Range("B13").Value) 'Résidence
Wd.Range("C35").Value = VBA.Format(Ws.Range("D13").Value, "d mmmm yyyy") 'Date depuis
'********************************
'* RENSEIGNEMENT RECAPITULATIF *
'********************************
Wr.Cells(Dl, 1).Value = VBA.Format(Ws.Range("B7").Value, "dd-mm-yyyy") 'D. Certificat
Wr.Cells(Dl, 2).Value = VBA.UCase(Ws.Range("B10").Value) 'Nom
Wr.Cells(Dl, 3).Value = Application.WorksheetFunction.Proper(Ws.Range("D10").Value) 'Prénoms
Wr.Cells(Dl, 4).Value = VBA.Format(Ws.Range("G10").Value, "d mmmm yyyy") 'D. Naiss
Wr.Cells(Dl, 5).Value = VBA.UCase(Ws.Range("B13").Value) 'Résidence
Wr.Cells(Dl, 6).Value = Ws.Range("G13").Value 'Titre Elus
Wr.Cells(Dl, 7).Value = Ws.Range("I13").Value 'Noms Elus
'********************************
'* IMPRESSION OUI/NON *
'********************************
If MsgBox("Voulez-vous imprimez le formulaire ?", vbInformation + vbYesNo, "Impression") = vbYes Then
Wd.PrintPreview 'PrintOut
End If
'********************************
'* RAZ SAISIE & FORMULAIRE *
'********************************
Ws.Range("B10,D10,G10,I10,B13,D13,F13") = ""
Wd.Range("C27,C29,C31,C33,C35") = ""
End Sub
Saisie CR.V2.xlsm (47,9 Ko)
1 « J'aime »
Olivia
Février 14, 2019, 9:02
5
Re,
Un grand merci Mimimathy pour ton aide.
Bonne semaine
Re,
Ok
Si ton problème est résolu, cliquer sur le petit sous la solution pour la valider.
A la prochaine
system
A fermé ce sujet ()
Mars 16, 2019, 7:25
7
Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.