Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to pass system constants as arguments to a procedure or function. In
my case, I want to pass the constants xlThick/xlMedium of the 'Weight' property to a procedure. How do I have to do this? many thanks roland |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just noted your example - in case you didn't know, the Range object has a
method called BorderAround eg. Selection.BorderAround Weight:=xlThick -- Rob van Gelder - http://www.vangelder.co.nz/excel "Lonnie M." wrote in message oups.com... 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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks--I am always on the lookout for a better way, and you certainly
provided one. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Arguments in Excell | Excel Worksheet Functions | |||
Passing Variable Number of Arguments to a Sub | Excel Discussion (Misc queries) | |||
passing arguments by postion through application.run | Excel Programming | |||
Passing Arguments | Excel Programming | |||
Passing arguments to a sub routine... | Excel Programming |