• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need to decode this

Loop Until LE = rs("Expr1").Value Or intCounter = 100
-------------------------------------------------------------------------------
Cells(intCounter, 8) = rs("book").Value
-------------------------------------------------------------------------------
sqlReasonCount = " SELECT COUNT(*) as count FROM (SELECT [reason code] FROM append_assets" & _" GROUP BY [reason code]);"
-------------------------------------------------------------------------------
With Range(Cells(10, 1), Cells(reason_count + 9, 7))
.ClearContents
.Interior.Color = 16777215
End With
-------------------------------------------------------------------------------
quote = Chr(34)
Cells(10, 6).Borders(xlEdgeTop).LineStyle = xlContinuous
Cells(reason_count + 9, 6).Borders(xlEdgeBottom).LineStyle = xlContinuous
For row = 10 To reason_count + 9
Cells(row, 1) = row - 8
With Cells(row, 5)
-------------------------------------------------------------------------------
 
Loops until LE = the Expr1 parameter of rs, Or until the intCounter = 100, whichever comes first
------------
Set the cell at row intCounter (so, some integer) and column 8 equal to the book parameter of rs.
---------
Create an SQL code.
----------
With the block of cells from A10 to some other cell past G9 (depending on reason_count value), clear the contents, and change the color of cell background
----------
Set the quote variable equal to a character (the double quotation mark)
Set the border of cell F10 to go all the way around (continuous)
Set the bottom border of some other cell to be continuous.
Begin a loop from 10 to the value of reason_count + 9
With the cell in col A, row equal to row variable, set the value equal to the row variable - 8.
Begin a With statement.
 
Also, you may find it helpful to step through your code line by line using the F8 key. This will let you see what is going on as the code progresses. You can also hover your mouse over different variables in the code as it runs to see what the value is. Being able to see how the code runs and how the changes are made would be more beneficial for learning than us simply stating what the code programmatically does.
 
Back
Top