Onderstaande code werkt goed voor kolom P:Q
Private Sub Worksheet_Change(ByVal target As Range)
If Not Intersect(target, Columns("P:Q")) Is Nothing And Not IsEmpty(target) And target.Cells.Count = 1 Then
Application.EnableEvents = False
target = Replace(Format(target / 100, "00.00"), ",", ":")
Application.EnableEvents = True
End If
End Sub
De code zou ook moeten werken voor kolom T:U, maar met deze code (die ik zelf zo gewijzigd heb) gaat dat niet goed.
Private Sub Worksheet_Change(ByVal target As Range)
If Not Intersect(target, Columns("P:Q"), Columns("T:U")) Is Nothing And Not IsEmpty(target) And target.Cells.Count = 1 Then
Application.EnableEvents = False
target = Replace(Format(target / 100, "00.00"), ",", ":")
Application.EnableEvents = True
End If
End Sub
Hoe pas ik de code aan zodat deze wel werkt op de vier kolommen.
M.vr.groeten
Adri
Private Sub Worksheet_Change(ByVal target As Range)
If Not Intersect(target, Columns("P:Q")) Is Nothing And Not IsEmpty(target) And target.Cells.Count = 1 Then
Application.EnableEvents = False
target = Replace(Format(target / 100, "00.00"), ",", ":")
Application.EnableEvents = True
End If
End Sub
De code zou ook moeten werken voor kolom T:U, maar met deze code (die ik zelf zo gewijzigd heb) gaat dat niet goed.
Private Sub Worksheet_Change(ByVal target As Range)
If Not Intersect(target, Columns("P:Q"), Columns("T:U")) Is Nothing And Not IsEmpty(target) And target.Cells.Count = 1 Then
Application.EnableEvents = False
target = Replace(Format(target / 100, "00.00"), ",", ":")
Application.EnableEvents = True
End If
End Sub
Hoe pas ik de code aan zodat deze wel werkt op de vier kolommen.
M.vr.groeten
Adri