View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lonnie M. Lonnie M. is offline
external usenet poster
 
Posts: 184
Default passing Excel system values (constant) of properties as arguments

Roland, this is how I have handled it:

Sub Test()
Call BoxBorder(xlThin)
End Sub

Public Sub BoxBorder(myWeight As Variant)
With Selection.Borders(xlEdgeLeft)
..LineStyle = xlContinuous
..Weight = myWeight
..ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
..LineStyle = xlContinuous
..Weight = myWeight
..ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
..LineStyle = xlContinuous
..Weight = myWeight
..ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
..LineStyle = xlContinuous
..Weight = myWeight
..ColorIndex = xlAutomatic
End With
End Sub


HTH--Lonnie M.