Consulting

Results 1 to 4 of 4

Thread: Worksheet_Change ( No Responese )

  1. #1
    VBAX Regular
    Joined
    Feb 2017
    Location
    Hong Kong
    Posts
    33
    Location

    Worksheet_Change ( No Responese )

    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

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    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

  3. #3
    VBAX Regular
    Joined
    Feb 2017
    Location
    Hong Kong
    Posts
    33
    Location
    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.

  4. #4
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    Show the workbook in an attachment that does not work.

    Artik

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •