Type Mismatch Error Using Target.Value

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have this code where the line in red is giving me a type mismatch error.

Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If Not mbevents Then Exit Sub
    tmrow = Target.Row 'trow = Target.Row
    tmcol = Target.Column 'tcol = Target.Column
    If tmcol < 13 Or tmcol > 16 Then
        If Target.Value = "" Then Exit Sub
    End If
    mbevents = False
    
    ... 
End Sub

tmrow = 34, and tmcol = 4
The value in cell(34,4) is text "Baltimore Nuggets"

Is anyone able to help me understand what might be causing this error?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Did you select more than one cell?
 
Upvote 0
Hmmm ... I can't say I didn't Fluff. I mean I didn't highlight more than one, but I may have changed one cell, and not realizing the code had stopped, selected another. Could that happen after code had stopped?

I tried again, this time paying closer attention to what I was doing, and I'm unable to recreate the error. So, I guess for now all is good.

Thank you!
 
Upvote 0
Glad it's ok & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,233
Messages
6,123,772
Members
449,123
Latest member
StorageQueen24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top