Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code not working
Here is the code I am having trouble with. It returns all "X"'s in the offset ranges, whereas there should be three "O"'s and one "", (blank).
Whe J = range A9 and A9 value is "B" RangerTest is a named range A1 to O1 of sheet1 RangerTest has these values: ABCDEBFGHIJBKL and O1 is blank When I run the code the offset values a XXXXXXXXXXXXXX and the last offset O1 is blank. The desired out come should be: XOXXXOXXXXXOXX (with the last offset blank in this example. Sub Testx() Dim J As String Dim RangerTest As Range, Cell As Range J = Range("A9").Value For Each Cell In Range("RangerTest") If Cell.Value = J Then Cell.Offset(5, 0).Value = "O" If Cell.Value < J Then Cell.Offset(5, 0).Value = "X" If Cell.Value = "" Then Cell.Offset(5, 0).Value = "" Next End Sub Can't figure where I am going wrong??? Regards Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code not working | Excel Programming | |||
Code not working | Excel Programming | |||
Code not working NOW ? But it was before??? | Excel Programming | |||
Pop up code not working | Excel Programming | |||
VB code is not working like it should | Excel Programming |