Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Try this: Code ------------------- Function copyARangeOfHours(lineNr) as Range Dim thisWb As Workbook Dim rangeOfHours As Range Set thisWb = ThisWorkbook thisWb.Worksheets("Needs").Select rangeOfHours = Range("C" & lineNr & ":N" & lineNr) set copyARangeOfHours = rangeOfHours End Functio ------------------- I didn't test it and I'm not sure about the added set but you do have to tell what kind of object you return matter of fact it's wise to declare the return type always and avoi using variants for everything tip: place Option Explicit to the top of every module, to enforce t declare every variable -- Dnere ----------------------------------------------------------------------- Dnereb's Profile: http://www.excelforum.com/member.php...fo&userid=2618 View this thread: http://www.excelforum.com/showthread.php?threadid=39491 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Returning a range using IF | Excel Worksheet Functions | |||
Returning a range | Excel Discussion (Misc queries) | |||
Returning the range name in VBA | Excel Programming | |||
Returning the range name in VBA | Excel Programming | |||
Returning the range name in VBA | Excel Programming |