View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Baapi[_6_] Baapi[_6_] is offline
external usenet poster
 
Posts: 1
Default Function - Malfunction


What is my error? in the following piece of code?
Format_Cells(A) is a function; A is a Range Object.

I'm trying to call the function Function Format_Cells(A As Range) in my
main code with error 424

---------------------------------------------------------------
Main Program
---------------------------------------------------------------
Dim A as Range
Range("Y11:BR41").Select
Set A = Worksheets("Summary").Range("Y11:BR41")
Format_Cells (A)
---------------------------------------------------------------
Function
---------------------------------------------------------------
Function Format_Cells(A As Range)
With Selection.Borders(xlEdgeLeft)
..LineStyle = xlContinuous
..Weight = xlThin
..ColorIndex = 16
End With
With Selection.Borders(xlEdgeTop)
..LineStyle = xlContinuous
..Weight = xlThin
..ColorIndex = 16
End With
With Selection.Borders(xlEdgeBottom)
..LineStyle = xlContinuous
..Weight = xlThin
..ColorIndex = 2
End With
With Selection.Borders(xlEdgeRight)
..LineStyle = xlContinuous
..Weight = xlThin
..ColorIndex = 2
End With
With Selection.Borders(xlInsideVertical)
..LineStyle = xlContinuous
..Weight = xlHairline
..ColorIndex = 16
End With
With Selection.Borders(xlInsideHorizontal)
..LineStyle = xlContinuous
..Weight = xlHairline
..ColorIndex = 16
End With
With Selection.Interior
..ColorIndex = 19
..Pattern = xlSolid
..PatternColorIndex = xlAutomatic
End With
With Selection.Font
..Name = "Tahoma"
..FontStyle = "Regular"
..Size = 8
..ColorIndex = xlAutomatic
End With
End Function
----------------------------------------------------------------


--
Baapi
------------------------------------------------------------------------
Baapi's Profile: http://www.excelforum.com/member.php...o&userid=27333
View this thread: http://www.excelforum.com/showthread...hreadid=469377