Bonjour le forum
je reviens à vous car j'ai un souçi avec Worksheet_Change
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim derlig As Long, cellule As Range
If Intersect(Target, Range("B1")) Is Nothing Then: Exit Sub
Columns(2).Interior.ColorIndex = 0
derlig = Range("B65536").End(xlUp).Row
For Each cellule In Range(Cells(1, 2), Cells(derlig, 2))
If Left(cellule, 1) = "*" Then
cellule.Interior.ColorIndex = 36
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
If Intersect(Target, Range("B10😀65536,G10:G65536,J10:J65536")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Cell In Target
If VarType(Cell) = vbString And Not Cell.HasFormula Then Cell = UCase(Cell)
Next Cell
Application.EnableEvents = True
End Sub
Dim ligne As Integer
Private Sub Worksheet_Change(ByVal Target As Range)
Jusqu'ici tout fonctionne et dès lors que je rajoute ce code
j'ai une erreur de compilation
If Intersect(Target, [D1😀65536]) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
If ligne <> 1 Then
' si cellule de la colonne A modifiée différente de vide
If Range("D" & ligne).Value <> "" Then
' date dans cellule de la colonne B correspondant N° de ligne sélectionnée
Range("L" & ligne).Value = Now
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' N° de ligne de la cellulle sélectionnée
ligne = Target.Row
End Sub
merci de votre aide
je reviens à vous car j'ai un souçi avec Worksheet_Change
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim derlig As Long, cellule As Range
If Intersect(Target, Range("B1")) Is Nothing Then: Exit Sub
Columns(2).Interior.ColorIndex = 0
derlig = Range("B65536").End(xlUp).Row
For Each cellule In Range(Cells(1, 2), Cells(derlig, 2))
If Left(cellule, 1) = "*" Then
cellule.Interior.ColorIndex = 36
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
If Intersect(Target, Range("B10😀65536,G10:G65536,J10:J65536")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Cell In Target
If VarType(Cell) = vbString And Not Cell.HasFormula Then Cell = UCase(Cell)
Next Cell
Application.EnableEvents = True
End Sub
Dim ligne As Integer
Private Sub Worksheet_Change(ByVal Target As Range)
Jusqu'ici tout fonctionne et dès lors que je rajoute ce code
j'ai une erreur de compilation
If Intersect(Target, [D1😀65536]) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
If ligne <> 1 Then
' si cellule de la colonne A modifiée différente de vide
If Range("D" & ligne).Value <> "" Then
' date dans cellule de la colonne B correspondant N° de ligne sélectionnée
Range("L" & ligne).Value = Now
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' N° de ligne de la cellulle sélectionnée
ligne = Target.Row
End Sub
merci de votre aide