Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Cell Paste using cell link option Half works MardiT Excel Worksheet Functions 4 July 28th 08 06:51 PM
print half of rows on left and other half on right Steve B. Excel Discussion (Misc queries) 2 November 16th 07 11:20 AM
Cell protection only half works Angus Excel Discussion (Misc queries) 2 November 4th 06 06:10 PM
Why won't this code works ksnapp[_37_] Excel Programming 6 April 1st 04 01:44 PM
Code works in XL2000 but not in XP!? Big Chris[_21_] Excel Programming 2 December 13th 03 03:57 PM


All times are GMT +1. The time now is 09:38 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"