troubleshooting Question

Excel VBA

Avatar of ca1358
ca1358 asked on
Visual Basic Classic
5 Comments1 Solution297 ViewsLast Modified:
This is Excel VBA
1)I have this line, how do you compare both case, Example "tx" and "TX"
If Range("E" & x) = "tx" Then

I had this but I get an error of "Type Mismatch"
If Range("E" & x) = "tx" Or "TX" Then

And
2)For x = 25 To 2000
Is there a way to say row 25 - last row in "D", that has data

Any help would greatly be appreciated!!


This is the piece of code I am working on.
//////////////////////////////////

For x = 25 To 2000
If Range("E" & x) = "tx" Then
If Range("P" & x) = "YES" Then
Sheets("Data Input Sheet").Range("D" & x).Select
  Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
     With Selection.Interior
        .ColorIndex = 3
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
   End With
Else
End If
End If
Next
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros