Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a piece of code to insert into a routine. What I need is for the code
to place a boarder around each cell (column A through T) of the current row. The curser will not always be in the same cell when the code is run. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you can give this a try
Sub test() Dim currow As Long currow = ActiveCell.Row With Range("A" & currow & ":T" & currow).Borders(xlEdgeBottom) .Weight = xlThin End With With Range("A" & currow & ":T" & currow).Borders(xlEdgeTop) .Weight = xlThin End With With Range("A" & currow & ":T" & currow).Borders(xlEdgeRight) .Weight = xlThin End With With Range("A" & currow & ":T" & currow).Borders(xlEdgeLeft) .Weight = xlThin End With With Range("A" & currow & ":T" & currow).Borders(xlInsideVertical) .Weight = xlThin End With End Sub -- Gary "Patrick Simonds" wrote in message ... I need a piece of code to insert into a routine. What I need is for the code to place a boarder around each cell (column A through T) of the current row. The curser will not always be in the same cell when the code is run. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Patrick Simonds wrote: I need a piece of code to insert into a routine. What I need is for the code to place a boarder around each cell (column A through T) of the current row. The curser will not always be in the same cell when the code is run. Sub Macro1() ' ' Macro1 Macro ' Macro recorded 22/11/2006 by Greg Glynn ' For x = 1 To 20 Cells(ActiveCell.Row, x).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 Next x End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formating cells | Excel Worksheet Functions | |||
Formating Cells | Excel Worksheet Functions | |||
conditional formating cells i Excel based on other cells values | Excel Worksheet Functions | |||
formating cells | Excel Programming | |||
Formating cells | Excel Programming |