Solved

Check a specific cell for a value using If

Posted on 2015-01-14
6
41 Views
Last Modified: 2015-02-07
How do I check AD2 for this value?  I cannot first use a select AD2, need it in an IF
I need to Exit a sub if this is true...  if not continue on.

If AD2 = "Dup Already Converted" Then 'This is the first cell cannot be = "Dup Already Converted"
MsgBox ("Yupper it is equal to Dup Already Converted")

Else
MsgBox ("Nope it is not equal to Dup Already Converted")

End If
0
Comment
Question by:RWayneH
  • 3
  • 2
6 Comments
 
LVL 45

Expert Comment

by:Martin Liss
ID: 40549814
Either this (not sure which you want)

If AD2 = "Dup Already Converted" Then 'This is the first cell cannot be = "Dup Already Converted"
MsgBox ("Yupper it is equal to Dup Already Converted")
Exit Sub
Else
MsgBox ("Nope it is not equal to Dup Already Converted")

End If

Open in new window


or this

If AD2 = "Dup Already Converted" Then 'This is the first cell cannot be = "Dup Already Converted"
MsgBox ("Yupper it is equal to Dup Already Converted")

Else
MsgBox ("Nope it is not equal to Dup Already Converted")
Exit Sub
End If

Open in new window

0
 

Author Comment

by:RWayneH
ID: 40549821
The issue is that it is equal to that and the If is not catching it....  It skips over and straight to End If ?? and I am not sure why?  Thought it is in the way I am writing it.
0
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40549834
Change AD2 to Range("AD2")
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 40595986
I've requested that this question be closed as follows:

Accepted answer: 500 points for Martin Liss's comment #a40549834

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 

Author Closing Comment

by:RWayneH
ID: 40595987
Thanks for the help
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now