Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Not seeing integer
xl2000
I am trying to introduce a variable into some existing code, below. I am trying to get the value of F to change depending on the value of A. The problem is with F, I think. When I simply set FT.value to 25 or 35 it runs fine. The code is running but not doing anything. Any help would be appreciated. Ta, Martin Public Sub FTwentyFive1() Dim Ce As Range Dim FT As Range Dim D As Range A = Application.WorksheetFunction.CountIf(Range("G8:I1 2"), "<-.05") B = Application.WorksheetFunction.CountIf(Range("J8:J1 0"), "<-.04") C = Application.WorksheetFunction.CountIf(Range("J11:J 12"), "<-.05") A = A + B + C If A = 0 Then F = 35 Else F = 25 For Each FT In Range("K7:K31") If FT.Value = F Then Set D = FT With D.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlColorIndexAutomatic End With Set Ce = D.Offset(-1, 0) With Ce.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlColorIndexAutomatic End With Exit For End If Next End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Not seeing integer
Hi Trevor,
Thanks, you are right. Ta, Martin "Trevor Shuttleworth" wrote in message ... Martin with a single value of -0.06 in cell G8 your code works for me. I suspect it's the data, not your code. Regards Trevor "Martin Wheeler" wrote in message ... xl2000 I am trying to introduce a variable into some existing code, below. I am trying to get the value of F to change depending on the value of A. The problem is with F, I think. When I simply set FT.value to 25 or 35 it runs fine. The code is running but not doing anything. Any help would be appreciated. Ta, Martin Public Sub FTwentyFive1() Dim Ce As Range Dim FT As Range Dim D As Range A = Application.WorksheetFunction.CountIf(Range("G8:I1 2"), "<-.05") B = Application.WorksheetFunction.CountIf(Range("J8:J1 0"), "<-.04") C = Application.WorksheetFunction.CountIf(Range("J11:J 12"), "<-.05") A = A + B + C If A = 0 Then F = 35 Else F = 25 For Each FT In Range("K7:K31") If FT.Value = F Then Set D = FT With D.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlColorIndexAutomatic End With Set Ce = D.Offset(-1, 0) With Ce.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlColorIndexAutomatic End With Exit For End If Next End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I add an integer to an existing integer? | Excel Worksheet Functions | |||
non-integer scrollbar | Charts and Charting in Excel | |||
integer | Excel Worksheet Functions | |||
help with rounding up to whole integer | Excel Discussion (Misc queries) | |||
positive integer? | Excel Discussion (Misc queries) |