Brians12,
At the moment your code is trying to find the value of Target within the range Data and then, when it finds it, it's setting the value of vResult to whatever value is 8 columns to the right. You seem to want to return the value 6 columns to the right, so is it as simple as changing the Offset arguments to (0, 6) or am I missing something?
By the way, there is no need to repeat the (opposite) conditions of an IF statement within the ELSE part of the conditional coding as this is automatically assumed. Hence (without any other changes) your code
could become, without any change of processVB:If Not WorksheetFunction.CountIf(wSht.Range("Data"), Target) > 0 Then MsgBox "Why you stupid TOAD. I outta beat you. That is not a valid mold name" Exit Sub Else If WorksheetFunction.CountIf(wSht.Range("Data"), Target) > 0 Then With wSht.Range("Data") vResult = .Find(What:=Target, After:=.Cells(1, 1), _ LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False).Offset(0, 8) End With If vResult = "Y" Then MsgBox "You are so darn good" Exit Sub Else If vResult <> "Y" Then MsgBox "You Suck" Exit Sub End If End If End If End If
Regards,VB:If Not WorksheetFunction.CountIf(wSht.Range("Data"), Target) > 0 Then MsgBox "Why you stupid TOAD. I outta beat you. That is not a valid mold name" Exit Sub Else With wSht.Range("Data") vResult = .Find(What:=Target, After:=.Cells(1, 1), _ LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False).Offset(0, 8) End With If vResult = "Y" Then MsgBox "You are so darn good" Exit Sub Else MsgBox "You Suck" Exit Sub End If End If
Batman.


Reply With Quote
Bookmarks