Bonjour à tous;
Comment je peux résoudre mon pb cette formule ne fonctionne plus "
=SI(J5>10;"Err:10";SI(J7<11;"Err:11";0)) " depuis que j'utilise cette
procédure, alors si on peur m'apporter une solution
merci
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' Pour affiche le nom de la cellule (A2) en nom de feuille
If Target.Address = "$A$2" Then
ActiveSheet.Name = [A2]
End If
If Target.Address = "$T$1" Then
' Pour afficher le numéro de semaine dans la cellule (R1)
Application.EnableEvents = False
m = Month(7 * [T1] + DateSerial(2007, 1, 3) - Weekday(DateSerial(2007,
1, 3)) - 5)
Sheets("calendrier").[D2].Offset(m - 1, 0).Copy
Target.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.EnableEvents = True
End If
'Pour format des heures
Dim TimeStr As String
On Error GoTo EndMacro
If Application.Intersect(Target, Range("E5:AF75")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count > 1 Then
Exit Sub
End If
If Target.Value = "" Then
Exit Sub
End If
Application.EnableEvents = False
With Target
If .HasFormula = False Then
Select Case Len(.Value)
Case 1 ' e.g., 1 = 00:01 AM
TimeStr = "00:0" & .Value
Case 2 ' e.g., 12 = 00:12 AM
TimeStr = "00:" & .Value
Case 3 ' e.g., 735 = 7:35 AM
TimeStr = Left(.Value, 1) & ":" & _
Right(.Value, 2)
Case 4 ' e.g., 1234 = 12:34
TimeStr = Left(.Value, 2) & ":" & _
Right(.Value, 2)
Case Else
Err.Raise 0
End Select
.Value = TimeValue(TimeStr)
End If
End With
Application.EnableEvents = True
Exit Sub
EndMacro:
MsgBox "Enter invalid avec les heures"
Application.EnableEvents = True
End Sub
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Tibert
Au temps pour moi c'est le format de ma condition qui n'est pas bon Excuser pour le dérrangement merci
Bonjour à tous; Comment je peux résoudre mon pb cette formule ne fonctionne plus " =SI(J5>10;"Err:10";SI(J7<11;"Err:11";0)) " depuis que j'utilise cette procédure, alors si on peur m'apporter une solution merci Private Sub Worksheet_Change(ByVal Target As Excel.Range) ' Pour affiche le nom de la cellule (A2) en nom de feuille If Target.Address = "$A$2" Then ActiveSheet.Name = [A2] End If If Target.Address = "$T$1" Then ' Pour afficher le numéro de semaine dans la cellule (R1) Application.EnableEvents = False m = Month(7 * [T1] + DateSerial(2007, 1, 3) - Weekday(DateSerial(2007, 1, 3)) - 5) Sheets("calendrier").[D2].Offset(m - 1, 0).Copy Target.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:úlse, Transpose:úlse Application.EnableEvents = True End If 'Pour format des heures Dim TimeStr As String On Error GoTo EndMacro If Application.Intersect(Target, Range("E5:AF75")) Is Nothing Then Exit Sub End If If Target.Cells.Count > 1 Then Exit Sub End If If Target.Value = "" Then Exit Sub End If
Application.EnableEvents = False With Target If .HasFormula = False Then Select Case Len(.Value) Case 1 ' e.g., 1 = 00:01 AM TimeStr = "00:0" & .Value Case 2 ' e.g., 12 = 00:12 AM TimeStr = "00:" & .Value Case 3 ' e.g., 735 = 7:35 AM TimeStr = Left(.Value, 1) & ":" & _ Right(.Value, 2) Case 4 ' e.g., 1234 = 12:34 TimeStr = Left(.Value, 2) & ":" & _ Right(.Value, 2) Case Else Err.Raise 0 End Select .Value = TimeValue(TimeStr) End If End With Application.EnableEvents = True Exit Sub EndMacro: MsgBox "Enter invalid avec les heures" Application.EnableEvents = True End Sub
Au temps pour moi c'est le format de ma condition qui n'est pas bon
Excuser pour le dérrangement
merci
Bonjour à tous;
Comment je peux résoudre mon pb cette formule ne fonctionne plus "
=SI(J5>10;"Err:10";SI(J7<11;"Err:11";0)) " depuis que j'utilise cette
procédure, alors si on peur m'apporter une solution
merci
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' Pour affiche le nom de la cellule (A2) en nom de feuille
If Target.Address = "$A$2" Then
ActiveSheet.Name = [A2]
End If
If Target.Address = "$T$1" Then
' Pour afficher le numéro de semaine dans la cellule (R1)
Application.EnableEvents = False
m = Month(7 * [T1] + DateSerial(2007, 1, 3) - Weekday(DateSerial(2007,
1, 3)) - 5)
Sheets("calendrier").[D2].Offset(m - 1, 0).Copy
Target.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _
SkipBlanks:úlse, Transpose:úlse
Application.EnableEvents = True
End If
'Pour format des heures
Dim TimeStr As String
On Error GoTo EndMacro
If Application.Intersect(Target, Range("E5:AF75")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count > 1 Then
Exit Sub
End If
If Target.Value = "" Then
Exit Sub
End If
Application.EnableEvents = False
With Target
If .HasFormula = False Then
Select Case Len(.Value)
Case 1 ' e.g., 1 = 00:01 AM
TimeStr = "00:0" & .Value
Case 2 ' e.g., 12 = 00:12 AM
TimeStr = "00:" & .Value
Case 3 ' e.g., 735 = 7:35 AM
TimeStr = Left(.Value, 1) & ":" & _
Right(.Value, 2)
Case 4 ' e.g., 1234 = 12:34
TimeStr = Left(.Value, 2) & ":" & _
Right(.Value, 2)
Case Else
Err.Raise 0
End Select
.Value = TimeValue(TimeStr)
End If
End With
Application.EnableEvents = True
Exit Sub
EndMacro:
MsgBox "Enter invalid avec les heures"
Application.EnableEvents = True
End Sub
Au temps pour moi c'est le format de ma condition qui n'est pas bon Excuser pour le dérrangement merci
Bonjour à tous; Comment je peux résoudre mon pb cette formule ne fonctionne plus " =SI(J5>10;"Err:10";SI(J7<11;"Err:11";0)) " depuis que j'utilise cette procédure, alors si on peur m'apporter une solution merci Private Sub Worksheet_Change(ByVal Target As Excel.Range) ' Pour affiche le nom de la cellule (A2) en nom de feuille If Target.Address = "$A$2" Then ActiveSheet.Name = [A2] End If If Target.Address = "$T$1" Then ' Pour afficher le numéro de semaine dans la cellule (R1) Application.EnableEvents = False m = Month(7 * [T1] + DateSerial(2007, 1, 3) - Weekday(DateSerial(2007, 1, 3)) - 5) Sheets("calendrier").[D2].Offset(m - 1, 0).Copy Target.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:úlse, Transpose:úlse Application.EnableEvents = True End If 'Pour format des heures Dim TimeStr As String On Error GoTo EndMacro If Application.Intersect(Target, Range("E5:AF75")) Is Nothing Then Exit Sub End If If Target.Cells.Count > 1 Then Exit Sub End If If Target.Value = "" Then Exit Sub End If
Application.EnableEvents = False With Target If .HasFormula = False Then Select Case Len(.Value) Case 1 ' e.g., 1 = 00:01 AM TimeStr = "00:0" & .Value Case 2 ' e.g., 12 = 00:12 AM TimeStr = "00:" & .Value Case 3 ' e.g., 735 = 7:35 AM TimeStr = Left(.Value, 1) & ":" & _ Right(.Value, 2) Case 4 ' e.g., 1234 = 12:34 TimeStr = Left(.Value, 2) & ":" & _ Right(.Value, 2) Case Else Err.Raise 0 End Select .Value = TimeValue(TimeStr) End If End With Application.EnableEvents = True Exit Sub EndMacro: MsgBox "Enter invalid avec les heures" Application.EnableEvents = True End Sub