abtony
XLDnaute Impliqué
Bonjour a tous,
comment définir le format date dans ce code en colonne 3
	
	
	
	
	
		
Merci d'avance pour votre aide
Cordialement
Abtony
	
		
			
		
		
	
				
			comment définir le format date dans ce code en colonne 3
		VB:
	
	
	 Private Sub Label15_Click()
Dim tableau() As Variant
    Dim i As Integer
    Dim j As Byte
    Dim wsa As Worksheet
    Dim ligne
    Dim n As Byte
    Set wsa = ThisWorkbook.Worksheets("Imprim")
    If OptionButton1.Value = False And OptionButton2.Value = False And OptionButton3 = False Then
        MsgBox "Sélectionner format date ou client", vbExclamation, G
        OptionButton1.SetFocus
        Exit Sub
    End If
    
    Application.ScreenUpdating = False
    'Workbooks.Add 'création d'un nouveau classeur temporaire
    'wsa.Cells("A2").Select
    wsa.Range("A3:I65000").Clear
    tableau() = ListBox1.List
    j = ListBox1.ColumnCount
    i = ListBox1.ListCount + 2
    wsa.Range("A3:" & Cells(i, j).Address) = tableau()
    
    wsa.Cells(ligne, 3).Value = CDbl(Val(ListBox1.List(i, 3))) ' j'essaye sur cette ligne mais sans succès.
    
    
wsa.Range("B1").Value = GestAchats.Caption
Dim x As Integer, L As Integer, nombre_de_colonne As Integer
 
  nombre_de_colonne = 9
  For x = 5 To nombre_de_colonne
    L = wsa.Cells(Rows.Count, x).End(xlUp).Row
    wsa.Cells(L + 1, x).Formula = "=SUM(" & Cells(2, x).Address & ":" & Cells(L, x).Address & ")"
    wsa.Cells(L + 1, x).Interior.ColorIndex = 37
    wsa.Cells(L + 1, x).Font.Bold = True
  wsa.Range("A3:" & Cells(i, j).Address).EntireColumn.AutoFit
  Next
Application.ScreenUpdating = True
    On Error Resume Next
    'wsa.PrintOut 'impression
    'wsa.Range("A3:I65000").Clear
End Sub
	Merci d'avance pour votre aide
Cordialement
Abtony