color row using macro..

R

Rick Rothstein \(MVP - VB\)

You are talking about that statement as part of this block of code, right?
For Each cc In Range(Cells(c.Row, 1), Cells(c.Row, lc))
If Len(Application.Trim(cc)) > 0 Then
cc.Borders.LineStyle = xlContinuous
cc.Borders.Weight = xlMedium
End If
Next cc

I would think the 'If Len(Application.Trim(cc)) > 0 Then' statement should
already be doing what you ask. Have you modified this block of code in any
way? If yes, you need to show us what you did.

Rick


Hi, Thanks.
How can I make the statement below to only do the Borders to cells
that are not empty, cells that have no values should not have borders.

cc.Borders.LineStyle = xlContinuous

Thanks.
 
M

marc747

Hi, Yes that is the Code, and no I have not modified it.
I believe the code looks at the rows and if any cells in the row that
has a value it does the Borders to that row, but I want it to do the
Borders only to each cell that has a value.

Thanks,
 
J

j j

Sub Macro1()


For x = 3 To 1500
For y = 3 To 1500
If Cells(x, 2).Value = Cells(y, 6).Value Then
Cells(x, 7).Value = "true"
Cells(x, 3).Interior.ColorIndex = 36
Cells(x, 8).Value = y
Cells(y, 4).Interior.ColorIndex = 36

Else
End If
Next y
Next x


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top