Makro'da Kenarlık ?

Katılım
25 Temmuz 2005
Mesajlar
24
Makroda Bir hücrenin kenarlıklarını nasıl değiştirebilirim.
Ufak bir örnek lazım, teşekürler
Syg.
 
Katılım
25 Temmuz 2005
Mesajlar
24
Ben buldum ihtiyacı olana sunulur :hey:
Kod:
Sub TestRng()
Dim rng As Range
Set rng = Range("A2:b4")  'Excel macro test code
'Note iRow = Start Row of Range and iRow2= Ending Row of Range
'Set rng = oXLApp.Range(Cells(iRow, 1), oXLApp.Cells(iRow2,1).End(xlToRight))
grid rng
End Sub


Sub grid(rng)
    rng.Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
End Sub
 
Üst