Type Mismatch
Find bottlenecks in your Excel workbooks
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Type Mismatch

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Stockton, California
    Posts
    281
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi again,

    I have the following code:
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)

    If Target.Column = 1 Then
    If Target = "x" Or Target = "X" Then
    Target.Offset(0, 7) = Date
    Target.Offset(0, = Application.UserName
    Else
    Target.Offset(0, 7) = ""
    Target.Offset(0, = ""
    End If
    End If

    End Sub

    Which populates the Date and username when a user puts an x in column 1.

    This works fine, but i also have a macro that cuts and pastes rows and clears the x. When i run the macro, i get a type mismatch error. Im sure its because the macro is clearing the x. How do i get around this? can i maybe disable the worksheeet_change when i run my other macro?

    Thanks

    Note, those are not really faces, its supposed to be 8 and ) , heh

    [ This Message was edited by: robfo0 on 2002-03-10 19:05 ]

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In the other routine put

    Application.enableevents = False

    before it starts THEN @ the end of the routine
    Put in
    Application.enableevents=true


    This will disable the events incase your routine
    IS ?? within the range.

    Ivan

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Stockton, California
    Posts
    281
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thanks! works perfectly

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com