1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Private Sub CommandButton1_Click()
If DTPDate2.Caption > Label1.Caption Then
MsgBox "Veuillez selectionner une période valide.", vbExclamation, "Saisie Incorrecte"
Exit Sub
End If
Dim nWkbk As New Workbook
Set nWkbk = Workbooks.Add
ActiveWorkbook.Sheets("Relevés").Cells("A1:A115").Copy , nWkbk.Sheets("Relevés")
nWkbk.SaveAs Filename = "T:\APE\VBA"
'Worksheets("Relevés").Select
'Range("A1:A115").Copy
Unload UserForm1
' Dim nl As Long, nc As Integer
' With Me.lstWithAddItem
' nl = .ListCount ' Nbre de lignes
'nc = .ColumnCount ' Nbre de colonnes
' End With
' With shtExport
'.Cells.Clear ' Efface les cellules de la feuille
' .Range(.Cells(1, 1), .Cells(nl, nc)) = Me.lstWithAddItem.List
' End With
End Sub |
Partager