LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with returning a Range


Need help with returning a Range.

Dim rng As Range

rng = copyARangeOfHours(11)

---------------------------------------------------------------------

Function copyARangeOfHours(lineNr)
Dim thisWb As Workbook
Dim rangeOfHours As Range

Set thisWb = ThisWorkbook
thisWb.Worksheets("Needs").Select
rangeOfHours = Range("C" & lineNr & ":N" & lineNr)

'my try of returning
copyARangeOfHours = rangeOfHours
End Function

I get the error msg object variable not se

--
Newbie8
-----------------------------------------------------------------------
Newbie80's Profile: http://www.excelforum.com/member.php...fo&userid=2594
View this thread: http://www.excelforum.com/showthread.php?threadid=39491

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning a range using IF Alan Excel Worksheet Functions 3 September 12th 07 11:08 PM
Returning a range ledzepe Excel Discussion (Misc queries) 7 February 17th 06 10:08 PM
Help with returning a Range Dnereb Excel Programming 0 August 11th 05 01:30 PM
Returning the range name in VBA John Tjia[_2_] Excel Programming 4 October 20th 04 02:09 PM
Returning the range name in VBA John Tjia[_3_] Excel Programming 0 October 12th 04 03:28 PM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"