LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop in my macro doesn't seem to be running; however, it compiles fine...


I have a loop in my code which compiles fine; however, it doesn't see
to be running (or doing anything?) . The loop is supposed t
check the values of Column C in each row, If the value is different tha
the row below it, then it draws a line along the bottom of all thos
cells. The code is as follows with comments in blue:

For i = 2 To 1000 'run loop a maximum of 1000 iterations
j = i + 1 'j is 1 more than i so that j can be used t
check the next row
If ThisWorkbook.Worksheets("Sheet1").Cells(j, "C").Value < "
Then 'check to see If Column C in the row after row(i) isn't empty, i
False then exit the loop
If ThisWorkbook.Worksheets("Sheet1").Cells(i, "C").Value <
ThisWorkbook.Worksheets("Sheet1").Cells(j, "C").Value Then 'check t
see if row(i) column C and row(j) column C have different values, i
true then row(i) needs to get formatted with a line along the bottom o
all row(i)'s cells
With Rows("i:i").Borders(xlEdgeBottom) 'Create a lin
along the bottom of all of row(i)'s cells
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End If
End If
Next

--
Goobie
-----------------------------------------------------------------------
Goobies's Profile: http://www.excelforum.com/member.php...fo&userid=3076
View this thread: http://www.excelforum.com/showthread.php?threadid=50668

 
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
Excel Macro runs fine, but freezes if I try to do ANYTHING else whileit's running Rruffpaw Setting up and Configuration of Excel 0 August 3rd 11 08:31 PM
Macro fine Run fine from Select but not from KB Shortcut? [email protected] Excel Discussion (Misc queries) 8 August 31st 06 02:06 AM
Macro hangs up often but sometimes works fine Jeff Excel Worksheet Functions 3 June 13th 06 01:01 PM
Macro Compiles Sheets to One Book...Small Modification Needed TEAM[_7_] Excel Programming 1 September 15th 05 06:12 PM
Macro works fine in xl2002 but does not in xl 2000 Nolin[_2_] Excel Programming 1 February 25th 04 05:58 PM


All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"