case question

J

john

Looking at a range, say B7 to B1000, if B contains 787 or 790 to 794,
I want to change the cell in column A of that row to 8. I think, if I
undarstand correctly, that this is where one would use the case
function. I don't understand the function, though - I'm a poor
programmer, to put it mildly. How do I do this?

thanks
 
A

Auric__

john said:
Looking at a range, say B7 to B1000, if B contains 787 or 790 to 794,
I want to change the cell in column A of that row to 8. I think, if I
undarstand correctly, that this is where one would use the case
function. I don't understand the function, though - I'm a poor
programmer, to put it mildly. How do I do this?

Like this:

For n = 7 To 1000
Select Case Cells(n, 2).Value
Case 787, 790 To 794
Cells(n, 1).Value = 8
End Select
Next
 

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

Top