View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Range.Value fails

A function can only return a value. In this case, PutVectorInRange should
return a value of True or False as you have defined it as Boolean.

However, you don't actually set the value of the function anywhere within
the function.

You cannot set/change the value in another cell or range within a function.

Regards

Trevor


"vga1976" wrote in message
...

Sorry, this is the code

Function PutVectorInRange(vector As Variant, xlWs As Excel.Worksheet,
iCol As Integer, lRow As Long) As Boolean
Dim xlRange As Excel.Range
Dim lSize As Long, vColVector As Variant

If Not IsEmpty(vector) Then
lSize = UBound(vector, 1) - LBound(vector, 1)
Set xlRange = xlWs.Range(xlWs.Cells(lRow, iCol), xlWs.Cells(lRow +
lSize, iCol))
'convert the row vector to column vector
vColVector = DepConvertRowVectToColVect(vector)

xlRange.Value = vColVector
End If
End Function


--
vga1976
------------------------------------------------------------------------
vga1976's Profile: http://www.officehelp.in/member.php?userid=5683
View this thread: http://www.officehelp.in/showthread.php?t=1310532

Posted from - http://www.officehelp.in