Integrer code aggrandissement/retrecissement USF dans USF existant
S
Bonjour,
J'ai le code suivant :
Private Sub cmdReset_Click()
Dim i As VbMsgBoxResult
i = MsgBox("Do you want to reset the form?", vbYesNo + vbQuestion, "Reset")
If i = vbNo Then Exit Sub
Call Initialize_PendingComplaint
End Sub
Private Sub cmdSubmit_Click()
Dim i As VbMsgBoxResult
i = MsgBox("Do you want to submit the data?", vbYesNo + vbQuestion, "Submit")
If i = vbNo Then Exit Sub
If ValidatePending = False Then Exit Sub
Dim sh As Worksheet
Dim iRow As Long
Set sh = ThisWorkbook.Sheets("Pending_Complaints")
iRow = sh.Range("A" & Rows.Count).End(xlUp).Row + 1
With frmComplaint
sh.Range("A" & iRow).Value = .txtDate.Value
sh.Range("B" & iRow).Value = .txtEmpName.Value
sh.Range("C" & iRow).Value = .txtCustName.Value
sh.Range("D" & iRow).Value = .txtEmail.Value
sh.Range("E" & iRow).Value = .cmbCountry.Value
sh.Range("F" & iRow).Value = .cmbReason.Value
sh.Range("G" & iRow).Value = .cmbPriority.Value
sh.Range("H" & iRow).Value = IIf(.chkVIP.Value, "Yes", "No")
sh.Range("I" & iRow).Value = .txtDescription.Value
End With
Call Initialize_PendingComplaint
End Sub
Private Sub lstPendingComplaints_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If Me.lstPendingComplaints.List(Me.lstPendingComplaints.ListIndex, 0) = "" Then Exit Sub
Load frmResolve
With frmResolve
.txtDate.Value = [text(Today(), "DD-MMM-YYYY")]
.txtDate.Enabled = False
.txtEmpName.Value = Environ("username")
.txtEmpName.Enabled = False
.txtCustName.Value = Me.lstPendingComplaints.List(Me.lstPendingComplaints.ListIndex, 2)
.txtCustName.Enabled = False
.txtCustEmail.Value = Me.lstPendingComplaints.List(Me.lstPendingComplaints.ListIndex, 3)
.txtCustEmail.Enabled = False
.txtSummary.Value = ""
.Show
End With
End Sub
Private Sub MultiPage_Change()
Dim i As Long, j As Long, k As Long
If MultiPage.Value = 0 Then
i = [Countif(Pending_Complaints!G:G, "High")]
j = [Countif(Pending_Complaints!G:G, "Medium")]
k = [Countif(Pending_Complaints!G:G, "Low")]
With frmComplaint
.frmSummary.Caption = "Pending Complaints Summary"
.LblHigh.Caption = i
.lblMedium.Caption = j
.lblLow.Caption = k
.lblOverall.Caption = i + j + k
End With
Else
i = [Countif(Resolved_Complaints!G:G, "High")]
j = [Countif(Resolved_Complaints!G:G, "Medium")]
k = [Countif(Resolved_Complaints!G:G, "Low")]
With frmComplaint
.frmSummary.Caption = "Resoled Complaints Summary"
.LblHigh.Caption = i
.lblMedium.Caption = j
.lblLow.Caption = k
.lblOverall.Caption = i + j + k
End With
End If
End Sub
Private Sub UserForm_Initialize()
Call Initialize_PendingComplaint
End SubJe souhaite y inserer un code pour ajouter la possibilite de mettre l User Form en plein ecran , retrecir,etc... le code est ci dessous :
Option Explicit
Dim Lg As Single
Dim Ht As Single
Dim Fini As Boolean
Private Sub UserForm_Initialize()
Dim i As Integer, L As Integer, TB
InitMaxMin Me.Caption
Ht = Me.Height
Lg = Me.Width
For i = 1 To 31: ListJ.AddItem i: Next
TB = Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre")
For i = 0 To 11: CbMois.AddItem TB(i): Next
For i = Year(Date) - 1 To Year(Date) - 80 Step -1: CbAnnee.AddItem i: Next
End Sub
Private Sub UserForm_Resize()
Dim RtL As Single, RtH As Single
If Me.Width < 300 Or Me.Height < 200 Or Fini Then Exit Sub
RtL = Me.Width / Lg
RtH = Me.Height / Ht
Me.Zoom = IIf(RtL < RtH, RtL, RtH) * 100
End Sub
Private Sub UserForm_Terminate()
Fini = True
End Sub
A quel endroit du code initial dois-je ajouter celui la et ques dois je retirer/modifier pour le fusionner avec l autre ?
Merci!