Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add an integer to an existing integer? Aaron Excel Worksheet Functions 3 December 17th 09 09:46 PM
non-integer scrollbar Brad Charts and Charting in Excel 3 November 7th 07 03:27 AM
integer integer format Excel Worksheet Functions 1 May 3rd 07 06:45 PM
help with rounding up to whole integer kjcramp Excel Discussion (Misc queries) 3 April 10th 06 07:00 PM
positive integer? JZip Excel Discussion (Misc queries) 2 January 7th 05 06:37 PM


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"