Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using a for-next statement for finding values in certain ranges.
When I use whole numbers, there is no problem and everything work allright. But in one range I need to beable to use decimal numbers, an suddenly my code seems to contain errors. Here is the working code: If Not pro1.text = "" Then fa = pro1.text fb = pro2.text For x = fa To fb For y = 1 To 5 Set c = Range("F2:F2000").Find(fa, ActiveCell, xlValues, _ xlWhole, xlByColumns, xlNext) If Not c Is Nothing Then c.Activate c.Interior.ColorIndex = 7 c.Offset(0, -1).Interior.ColorIndex = 7 c.Offset(0, -2).Interior.ColorIndex = 7 c.Offset(0, -3).Interior.ColorIndex = 7 c.Offset(0, -4).Interior.ColorIndex = 7 c.Offset(0, -5).Interior.ColorIndex = 7 End If y = y + 1 Next y fa = fa + 1 Next x End If And the code that doesn't work: If Not ppe1.text = "" Then ga = ppe1.text gb = ppe2.text For x = ga To gb For y = 1 To 5 Set c = Range("G2:G2000").Find(ga, ActiveCell, xlValues, _ xlWhole, xlByColumns, xlNext) If Not c Is Nothing Then c.Activate c.Interior.ColorIndex = 8 c.Offset(0, -1).Interior.ColorIndex = 8 c.Offset(0, -2).Interior.ColorIndex = 8 c.Offset(0, -3).Interior.ColorIndex = 8 c.Offset(0, -4).Interior.ColorIndex = 8 c.Offset(0, -5).Interior.ColorIndex = 8 c.Offset(0, -6).Interior.ColorIndex = 8 End If y = y + 1 Next y ga = ga + 0.01 Next x End If As you can clearly see, the only thing I've changed is the interval fo the next value of x. I've spend the last three hours coming up with solutions, but nothin is working. I'm hoping one of you can see one?! tnx in advance, Pee -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Decimal Numbers typed into Excel 2003 read as whole numbers | Excel Discussion (Misc queries) | |||
Subtracting two 2-decimal place numbers gives result 13-decimal places? | Excel Worksheet Functions | |||
If then statement displaying 2 or 3 decimal places | Excel Worksheet Functions | |||
How can I sort mostly 3 decimal with some 4 decimal numbers | Excel Discussion (Misc queries) | |||
If Statement - in time not decimal minutes | Excel Worksheet Functions |