ReallyTrying
01-15-2007, 08:37 AM
Hi I really need a lot of help. I took a class and now I am trying to apply what I thought I learned. Not easy thus the name Really Trying.
Please help.
= IF(ISNUMBER(H2),(H2),IF(ISNUMBER(O2),(O2-H2),""))
My question relates to the lin of code listed above.
The purpose of is to calculate Aging so I am checking for a date in both columns if there are dates entered then subtract the start date from the end date.
The formula results in an invalid name error. if I seperate the two if statements then they work there is something wrong in the nesting of the two I think. Not sure what to do next.
Also,
This code is not working properly. Once the colors are determined they dont change even as the days increment. the first line is contained in the cells the sceond is a sub associated with the worksheet. Should this be congtained in a CheckChanged mod instead?
=CONCATENATE(IF(ISNUMBER(H3),NETWORKDAYS(H3,$AA$1),"0"))
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer, c
For Each c In Target
If Not Intersect(Range(c.Address), Range("AA1:AA1000")) Is Nothing Then
Select Case c.Value
Case 1 To 35
icolor = 27
Case 36 To 70
icolor = 26
Case 71 To 105
icolor = 44
Case 106 To 139
icolor = 45
Case 140 To 175
icolor = 46
Case 176 To 300
icolor = 3
Case Else
icolor = 0 'no color
End Select
c.Interior.ColorIndex = icolor
End If
Next c
End Sub
Please help.
= IF(ISNUMBER(H2),(H2),IF(ISNUMBER(O2),(O2-H2),""))
My question relates to the lin of code listed above.
The purpose of is to calculate Aging so I am checking for a date in both columns if there are dates entered then subtract the start date from the end date.
The formula results in an invalid name error. if I seperate the two if statements then they work there is something wrong in the nesting of the two I think. Not sure what to do next.
Also,
This code is not working properly. Once the colors are determined they dont change even as the days increment. the first line is contained in the cells the sceond is a sub associated with the worksheet. Should this be congtained in a CheckChanged mod instead?
=CONCATENATE(IF(ISNUMBER(H3),NETWORKDAYS(H3,$AA$1),"0"))
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer, c
For Each c In Target
If Not Intersect(Range(c.Address), Range("AA1:AA1000")) Is Nothing Then
Select Case c.Value
Case 1 To 35
icolor = 27
Case 36 To 70
icolor = 26
Case 71 To 105
icolor = 44
Case 106 To 139
icolor = 45
Case 140 To 175
icolor = 46
Case 176 To 300
icolor = 3
Case Else
icolor = 0 'no color
End Select
c.Interior.ColorIndex = icolor
End If
Next c
End Sub