macro custom error check

R

RussTheBear

For each matching value I find in column A, I need to check to see whether a
condition is true in another cell in different column but in the same row. I
need to limit the search by the size of the data as opposed to blanks because
there are blanks, so the beginning is necessary.

Range("D10").Select

x = ActiveCell.Row
y = ActiveCell.Column
w = 0

Do While Cells(x, y).Value <> ""
x = x + 1
w = w + 1
Loop

Range("A10").Select

x = ActiveCell.Row

Do Until x = w + 10
Cells(x, 1).Select
A = Cells(x, 1).Value
Cells(x, 3).Select
C = Cells(x, 3).Value
If (A = "purchased") And (C = 0) Then
Cells(x, 3).Select
MsgBox "The selected cell SHOULD have a posting reference number."
Exit Sub
Else
x = x + 1
End If

Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top