Execute on Cell Change - Problem

G

Guest

Hello, folks:

I'm trying to execute a series of code steps based on changes to ranges of
cells. I have used this code before, but for some reason it's not working
now and I can't spot why.

Basically, I want to change the value of cells in a column AB (28) of my
worksheet if any cell in ranges D8:F1000 or V8:X1000 change.

Here is the code. Can anyone spot anything obvious?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myRow&, myCol&
myRow = Target.Row
myCol = Target.Column
If myRow > 7 And myRow < 1001 Then
If (myCol > 6 And MyCOL < 9) Or _
(myCol > 21 And MyCOL < 25) Then

{code steps here, which do a row-by-row evaluation of the contents of the
target ranges and put a string of text (which varies depending upon the
contents of the targets) in the corresponding row in column 28.}

End If 'myCol
End If 'myRow

I commented out the code above and tried it with a command button and it
works fine, so I know the code steps are not the problem.

Thoughts? Thanks in advance.

MARTY
 
G

Guest

That did it. Thanks so much, Tom. I figued it was something simple I was
overlooking.

{Note to self: D = 4, D<>6 . . .}
 

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