View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SS[_3_] SS[_3_] is offline
external usenet poster
 
Posts: 14
Default If then Cell comparison with text.

I am trying to run an If..Then sequence that will look at
the value (Text Value) in Cell A1 and A4 and if they are
not equal insert a line on one side or the other.

For Example the following:

AB AB
AB AB
AB BC
BC BC
....

Would look like:
AB AB
AB AB
AB
BC BC
BC
....


So Far I have:

If Worksheets(5).Cells(Count, 1).Value Worksheets
(5).Cells(Count, 4).Value Then
Worksheets(5).Range(Cells(Count, 1), Cells(Count,
2)).Insert Shift:=xlDown
ElseIf Worksheets(5).Cells(Count, 1).Value < Worksheets
(5).Cells(Count, 4).Value Then
Worksheets(5).Range(Cells(Count, 4), Cells(Count,
5)).Insert Shift:=xlDown

End If


This does not work. It will keep inserting lines and
never stagger the cells.

Does anyone have any ideas?

Thank you

SS