ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   custom function - return range (https://www.excelbanter.com/excel-programming/364761-custom-function-return-range.html)

GinaW

custom function - return range
 
I have a fuction ABC that defines days of the week in a month (example June
1, 2006 = Thurday) for all days in a month based on passed Excel ser_number.
Function has an internal array (WeekDays) to hold this data. At the end I
need to assign these values to return. How is this done, because what I did
didn't work?
Note: wkDaysInM is the range name defined on the Excel sheet D.
the ABC fuction is placed for the range as = ABC(C!F1)
see below...

'assign the weekday (example: Monday) to the range
For i = 1 To 31
smfGetWkDayfromDate.Range("wkDaysInM").Offset(i - 1, 0) = WeekDays(i)
Next i
End Function

Would you please help me.
Many thanks.

--
GIW


All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com