Combined VBA line syntax
LineStyle and Weight are two separate properties of the Border object. You
would select border in the Object browser and see if it had a method that
supported an argument for setting lineStyle and Weight.
As far as I know, there is no such method. the closest thing that does is
BorderAround, but that would put a border all the way around the cell and,
while it has LineStyle and Weight arguments the help says:
You can specify either LineStyle or Weight, but not both. If you don't
specify either argument, Microsoft Excel uses the default line style and
weight.
--
Regards,
Tom Ogilvy
"Neal Zimm" wrote in message
...
Being mostly self taught in VBA I tried to combine lines a and b into c,
using line d as an example from recording a macro.
compiler did not like line c.
How do you know when "combining" lines will work and when it will not?
thanks.
Cells(x, y).Borders(xlEdgeLeft).LineStyle = xlContinuous '' a
Cells(x, y).Borders(xlEdgeLeft).Weight = xlThick '' b
Cells(x, y).Borders(xlEdgeLeft) LineStyle:=xlContinuous, Weight:=xlThick
'' c
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
'' d
--
Neal Z
|