M
Minitman
Hey Peter,
I am only working with one row (one record) at a time. I did catch
Tom's correction (thanks Tom).
I just realized after testing the adjusted code, that I am looking at
to many targets. It keeps cycling every time the UserForm puts down
the contents from each of up to 13 TextBoxes. How do I adjust the
code to look only in H (it is much easier to leave the conditions 1, 4
& 5 in the CF). There is a timing problem - H is pasted down after D.
The D entry sets up the condition for the H entry. If D has no entry
then the code looks to the entry in H and adds the color according to
the input of H ("Callahan, Nancy" present: True - color Index = 19,
False - color index = 6). If D has an entry (a bank account number),
then the code does not even look at the entry in H and the colors are
not wanted - at least this is how it is supposed to work. It is after
D gets an input that the long formulas kick in from the CF (which is
working)
Here is the adjusted code:
'>Row 1 is only Headers<
Set rMain = Range("A2:X250")
'>I need to check first for changes in D if none then changes in H<
'only concerned with changes in cols A-H, ie 1-8, right ?
Set rCheck = Intersect(Target, rMain)
If Not rCheck Is Nothing Then
xInt = xlAutomatic: xBdr = xlAutomatic
On Error GoTo errH
For Each r In rCheck.Rows
rw = r.Row
With rMain.Rows(rw)
If .Cells(1, 4) = "" Then
If .Cells(1, 8) = "Callahan, Nancy" Then
xInt = 6: xBdr = xlAutomatic
ElseIf Not .Cells(1, 8) = "Callahan, Nancy" Then
xInt = 39: xBdr = xlAutomatic
End If
End If
.Interior.ColorIndex = xInt
End With
returnHere:
xInt = xlAutomatic: xBdr = xlAutomatic
Next
End If
errH:
If rw Then
Resume returnHere
Else: Resume done
End If
End Sub
I am only working with one row (one record) at a time. I did catch
Tom's correction (thanks Tom).
I just realized after testing the adjusted code, that I am looking at
to many targets. It keeps cycling every time the UserForm puts down
the contents from each of up to 13 TextBoxes. How do I adjust the
code to look only in H (it is much easier to leave the conditions 1, 4
& 5 in the CF). There is a timing problem - H is pasted down after D.
The D entry sets up the condition for the H entry. If D has no entry
then the code looks to the entry in H and adds the color according to
the input of H ("Callahan, Nancy" present: True - color Index = 19,
False - color index = 6). If D has an entry (a bank account number),
then the code does not even look at the entry in H and the colors are
not wanted - at least this is how it is supposed to work. It is after
D gets an input that the long formulas kick in from the CF (which is
working)
Here is the adjusted code:
'>Row 1 is only Headers<
Set rMain = Range("A2:X250")
'>I need to check first for changes in D if none then changes in H<
'only concerned with changes in cols A-H, ie 1-8, right ?
Set rCheck = Intersect(Target, rMain)
If Not rCheck Is Nothing Then
xInt = xlAutomatic: xBdr = xlAutomatic
On Error GoTo errH
For Each r In rCheck.Rows
rw = r.Row
With rMain.Rows(rw)
If .Cells(1, 4) = "" Then
If .Cells(1, 8) = "Callahan, Nancy" Then
xInt = 6: xBdr = xlAutomatic
ElseIf Not .Cells(1, 8) = "Callahan, Nancy" Then
xInt = 39: xBdr = xlAutomatic
End If
End If
.Interior.ColorIndex = xInt
End With
returnHere:
xInt = xlAutomatic: xBdr = xlAutomatic
Next
End If
errH:
If rw Then
Resume returnHere
Else: Resume done
End If
End Sub