Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a loop in my code which compiles fine; however, it doesn't see to be running (or doing anything?) ![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Macro runs fine, but freezes if I try to do ANYTHING else whileit's running | Setting up and Configuration of Excel | |||
Macro fine Run fine from Select but not from KB Shortcut? | Excel Discussion (Misc queries) | |||
Macro hangs up often but sometimes works fine | Excel Worksheet Functions | |||
Macro Compiles Sheets to One Book...Small Modification Needed | Excel Programming | |||
Macro works fine in xl2002 but does not in xl 2000 | Excel Programming |