Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error with Borders of a Range
I am trying to draw borders around the columns in the ranges below. For some reason I am getting an Error indicated below: "Unable to set the weight property of the Border Class". This makes no sense to me because the code before it works fine but it keeps getting hung up on the line indicated below. Any ideas? ' adds border to quote sheet and product information With .Range("B" & ActiveCell.Row, "H" & ActiveCell.Row + 28) .Borders(xlEdgeTop).Weight = xlThin .Borders(xlEdgeBottom).Weight = xlThin .Borders(xlEdgeLeft).Weight = xlThin .Borders(xlEdgeRight).Weight = xlThin End With With .Range("C" & ActiveCell.Row, "G" & ActiveCell.Row + 28) .Borders(xlEdgeLeft).Weight = xlThin ERROR .Borders(xlEdgeRight).Weight = xlThin End With With .Range("F" & ActiveCell.Row, "F" & ActiveCell.Row + 28) .Borders(xlEdgeLeft).Weight = xlThin .Borders(xlEdgeRight).Weight = xlThin End With -- Cheers, Ryan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error with Borders of a Range
Ryan,
Your code works fine for me. HTH, Bernie MS Excel MVP "RyanH" wrote in message ... I am trying to draw borders around the columns in the ranges below. For some reason I am getting an Error indicated below: "Unable to set the weight property of the Border Class". This makes no sense to me because the code before it works fine but it keeps getting hung up on the line indicated below. Any ideas? ' adds border to quote sheet and product information With .Range("B" & ActiveCell.Row, "H" & ActiveCell.Row + 28) .Borders(xlEdgeTop).Weight = xlThin .Borders(xlEdgeBottom).Weight = xlThin .Borders(xlEdgeLeft).Weight = xlThin .Borders(xlEdgeRight).Weight = xlThin End With With .Range("C" & ActiveCell.Row, "G" & ActiveCell.Row + 28) .Borders(xlEdgeLeft).Weight = xlThin ERROR .Borders(xlEdgeRight).Weight = xlThin End With With .Range("F" & ActiveCell.Row, "F" & ActiveCell.Row + 28) .Borders(xlEdgeLeft).Weight = xlThin .Borders(xlEdgeRight).Weight = xlThin End With -- Cheers, Ryan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove borders in range | Excel Programming | |||
Borders for range | Excel Discussion (Misc queries) | |||
Borders Error | Excel Programming | |||
Bug applying Borders to Range | Excel Programming | |||
Remove all borders from a range | Excel Programming |