trying to return array why is this not working

Lino

Active Member
Joined
Feb 27, 2002
Messages
429
Dim myArray() as string


myArray = GetHolidays

compiler does not like line above

function GetHolidays() as string

dim HolidayArray(10)

'populates the array

GetHolidays = HolidayArray()

end function
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Lino

Active Member
Joined
Feb 27, 2002
Messages
429
i may have figure it out....

the function needs to be:

Function GetHolidays() as string()

please verify
 

tusharm

MrExcel MVP
Joined
May 28, 2002
Messages
11,028
Lino said:
i may have figure it out....

the function needs to be:

Function GetHolidays() as string()

please verify
Wouldn't it be easier -- and simpler -- and faster -- for you to verify this with a quick test? ;)
 

Lino

Active Member
Joined
Feb 27, 2002
Messages
429
i can't believe u wasted ur time to write that...and i guess the same is true for me...
 

Watch MrExcel Video

Forum statistics

Threads
1,118,909
Messages
5,574,979
Members
412,630
Latest member
Eireangel
Top