Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 112
Default Unable to match property error

Hello Kenny
Try this:
If Target.Cells.Count = 1 And Target.Value < "" And Target.Column = 9 Then
On Error Resume Next
dummy = Application.WorksheetFunction.Match(Target.Value,
Worksheets("Codes").Range("B:B"), 0)
If Err < 0 Then
MsgBox "No matching value found"
Err.Clear
On Error GoTo 0
Else
Application.EnableEvents = False
Target.Value = dummy
Application.EnableEvents = True
End If

End If

HTH
Cordially
Pascal

"Kenny" a écrit dans le message de news:
...
I need some help with my code. This code works perfect except for when
someone types in the cell. When someone types in the cell it causes an
unable
to match error. What code could I use to trap the error and prehaps clear
the
cell (or open to suggestions) before the match function is used?

If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 9 Then
If Target.Value = "" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.WorksheetFunction.Match(Target.Value,
Worksheets("Codes").Range("B:B"), 0)
End If
Application.EnableEvents = True



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to Set the XValues Property of the Series KathyC Charts and Charting in Excel 5 January 4th 07 09:26 PM
Unable to set the formula property of the series class Malhar Charts and Charting in Excel 1 July 24th 06 05:50 PM
Unable to set the XValues Property Ali Baba Charts and Charting in Excel 2 September 14th 05 04:54 AM
VBA error: Unable to set the Values property of the Series class Marco Shaw Charts and Charting in Excel 1 July 12th 05 02:34 PM
"Unable to get the NormSInv property of the WorksheetFunction clas David Roodman Excel Worksheet Functions 1 December 15th 04 12:15 PM


All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"