View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default With statement parameters


v = Array(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight, xlInsideVertical)
for i = lbound(v) to ubound(v)
With .Borders(v(i))
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
With .Font
.Name = "Arial"
.Size = 8
.Bold = False
.ColorIndex = xlAutomatic
End With
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End With


--
Regards,
Tom Ogilvy

"Arnold Klapheck" wrote:

I am getting an error message of, "wrong number of arguments or invalid
property assignment" and .Borders is highlighted. see between *@. I was
hoping to avoid having a separate with statement for every xlEdgeLeft,
xlEdgeTop etc. Can someone let me know if it can be done this way and what
I need to do to make it work? thanx

With Range("A1:AQ1")
.NumberFormat = "General"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
With *@.Borders*@(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight,
xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Font
.Name = "Arial"
.Size = 8
.Bold = False
.ColorIndex = xlAutomatic
End With
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End With