Excel 2003 - VBA for looping through every cell in a row to provide attributes/formatting

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-04-05T16:39:29Z Indexed on 2010/04/05 16:43 UTC
Read the original article Hit count: 457

say I want to make the first row of the excel ss something like this:

                  .Rows("1:1").Select
                    With Selection.Borders(xlEdgeLeft)
                        .LineStyle = xlContinuous
                        .Weight = xlMedium
                        .ColorIndex = xlAutomatic
                    End With
                    With Selection.Borders(xlEdgeTop)
                        .LineStyle = xlContinuous
                        .Weight = xlMedium
                        .ColorIndex = xlAutomatic
                    End With
                    With Selection.Borders(xlEdgeBottom)
                        .LineStyle = xlContinuous
                        .Weight = xlMedium
                        .ColorIndex = xlAutomatic
                    End With
                    With Selection.Borders(xlEdgeRight)
                        .LineStyle = xlContinuous
                        .Weight = xlMedium
                        .ColorIndex = xlAutomatic
                    End With

only I want each individual cells to have the outline, not the entire selection. how can i say for each cell in row 1, do the above idea

Thanks!

© Stack Overflow or respective owner

Related posts about excel-vba

Related posts about vba