Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear borders macro not working in Excel 2007 but works fine in 20
For some reason when I run this macro in Excel 2003 it works just fine. But
when I try to run it in Excel 2007 I get an Error indicated below. Anyone have any ideas why? Sub ClearRange () 'clears all borders With Range("B" & ActiveCell.Row, "H" & ActiveCell.Row + 30) Error = .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone .Borders(xlEdgeLeft).LineStyle = xlNone .Borders(xlEdgeTop).LineStyle = xlNone .Borders(xlEdgeBottom).LineStyle = xlNone .Borders(xlEdgeRight).LineStyle = xlNone .Borders(xlInsideVertical).LineStyle = xlNone .Borders(xlInsideHorizontal).LineStyle = xlNone End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear borders macro not working in Excel 2007 but works fine in 20
Works here. Worksheet isn't protected, etc.?
-- Jim "RyanH" wrote in message ... | For some reason when I run this macro in Excel 2003 it works just fine. But | when I try to run it in Excel 2007 I get an Error indicated below. Anyone | have any ideas why? | | Sub ClearRange () | | 'clears all borders | With Range("B" & ActiveCell.Row, "H" & ActiveCell.Row + 30) | Error = .Borders(xlDiagonalDown).LineStyle = xlNone | .Borders(xlDiagonalUp).LineStyle = xlNone | .Borders(xlEdgeLeft).LineStyle = xlNone | .Borders(xlEdgeTop).LineStyle = xlNone | .Borders(xlEdgeBottom).LineStyle = xlNone | .Borders(xlEdgeRight).LineStyle = xlNone | .Borders(xlInsideVertical).LineStyle = xlNone | .Borders(xlInsideHorizontal).LineStyle = xlNone | End With | | End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear borders macro not working in Excel 2007 but works fine in 20
Your macro worked just fine for me.
Try it with a new workbook best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "RyanH" wrote in message ... For some reason when I run this macro in Excel 2003 it works just fine. But when I try to run it in Excel 2007 I get an Error indicated below. Anyone have any ideas why? Sub ClearRange () 'clears all borders With Range("B" & ActiveCell.Row, "H" & ActiveCell.Row + 30) Error = .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone .Borders(xlEdgeLeft).LineStyle = xlNone .Borders(xlEdgeTop).LineStyle = xlNone .Borders(xlEdgeBottom).LineStyle = xlNone .Borders(xlEdgeRight).LineStyle = xlNone .Borders(xlInsideVertical).LineStyle = xlNone .Borders(xlInsideHorizontal).LineStyle = xlNone End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA errors in 2007 (works fine in 2003) | Excel Discussion (Misc queries) | |||
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 | Excel Discussion (Misc queries) | |||
XValues series breaks on disjoint ranges - but works fine in Excel 2007 | Excel Programming | |||
Macro hangs up often but sometimes works fine | Excel Worksheet Functions | |||
Macro works fine on PC; fails on Mac | Excel Programming |