PDA

View Full Version : Worksheet_Change ( No Responese )



justuptou
05-22-2019, 08:54 PM
I run the coding, it was worked.
but it is not worked when I re-opened the file.
Use "F8" step to active the coding, it is also no responese


Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = True
If Target.Column = 1 Then
If Target.Row >= 2 Then
Target = Cstr(Format(Target,"DD MMM YYYY")
End if
End if
End Sub

大灰狼1976
05-22-2019, 09:04 PM
Hi justuptou!
Worksheet events cannot be debugged with F8 unless interrupts (such as stop) are added to the code.

Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
If Target.Row >= 2 Then
Application.EnableEvents = False
Target = Cstr(Format(Target,"DD MMM YYYY")
Application.EnableEvents = True
End if
End if
End Sub

justuptou
05-23-2019, 07:23 PM
The coding was worked when I set it, the coding will be autorun when I change anything in worksheet.
when I reopen the file, the code can't be run / autorun.

Artik
05-24-2019, 12:39 AM
Show the workbook in an attachment that does not work.

Artik