Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Half of the code works?
This code moves the value Brk out of a series of 8 Cells with a value o
IND. If Brk Occurs in the first 3 cells it moves it to the front of th 8 cell group. If it occurs in the last three cells it should move it t the end of the 8 cells but it does not. Am I missing something? I pasted it in to a clean worksheet within the range, and it still doe not work all you need to do is type 8 cells with IND in them the replace the first or second cell with Brk like this IND IND Brk IND IND IND IND IND When working the result is Brk IND IND IND IND IND IND IND But when it is like this IND IND IND IND IND IND Brk IND It does not do this: IND IND IND IND IND IND IND Brk Thanks Dim i As Integer Dim j As Integer Dim startcolumn As Integer Dim endcolumn As Integer Dim startrow As Integer Dim endrow As Integer With Sheet236 startrow = 11 endrow = 298 startcolumn = 7 'Column D endcolumn = 102 'Column CX For i = startrow To endrow For j = startcolumn To startcolumn + 3 If .Cells(i, j).Value = "Brk" Then .Cells(i, j).Value = "IND" .Cells(i, startcolumn).Value = "Brk" End If Next j For j = endcolumn - 3 To endcolumn If .Cells(i, j).Value = "Brk" Then .Cells(i, j).Value = "IND" .Cells(i, endcolumn).Value = "Brk" End If Next j Next i End Wit -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Half of the code works?
That does help, thanks.
I just tried it again and I still can't get it to work. It only work if Brk appears in the first 4 cells (I increased it to 4) If it appear in the last four cells it won't move it to the right? Could you zip me back a copy of a workbook that you have it workin in? You can send it to and thanks agai -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Paste using cell link option Half works | Excel Worksheet Functions | |||
print half of rows on left and other half on right | Excel Discussion (Misc queries) | |||
Cell protection only half works | Excel Discussion (Misc queries) | |||
Why won't this code works | Excel Programming | |||
Code works in XL2000 but not in XP!? | Excel Programming |