Results 1 to 8 of 8

Thread: [RESOLVED] Excel VBA - Worksheet_Change Function

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2010
    Posts
    20

    Resolved [RESOLVED] Excel VBA - Worksheet_Change Function

    Hi,

    I am setting up a worksheet that contains some vba functions and among them, I wrote a code with Worksheet_change in order to call up a userform if the cell value in the target changes to 'sent'. Here is my code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("D531")) Is Nothing Then

    Select Case Target.Cells.Value
    Case "Sent"
    OrderSentTime_userform.Show
    End Select

    Else
    Unload OrderSentTime_userform
    Exit Sub

    End If

    End Sub

    The code works perfectly on its own. However, it doesn't when i fit it into the whole worksheet code, especially when i run another code that trying to clear the content of selected rows. And the error has been referred to the (case "Sent") as above. I couldn't figure out the reason for that. Could you please advice what's wrong to the code?

    Apologies if my explanation isn't clear enough, but i hope my sample worksheet attached help better.

    Thank you.

    xwxc
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width