LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Range object in Worksheetfunction.Sum


JLXL,

if you comment on my post, PLS read it carefully.
your code ONLY works IF DecisionScores is Active

Try following:

Dim MyRange As Range

'assume a fresh workbook (with =2 sheets)

Worksheets(1).Name = "Test
Worksheets(2).Name = "DecisionScores"
Worksheets(2).Activate
'this works
Set MyRange = _
Worksheets("DecisionScores").Range(Cells(3, 2), Cells(3,6))


'This will give a runtime error
Worksheets(1).Activate
Set MyRange = _
Worksheets("DecisionScores").Range(Cells(3, 2), Cells(3,6))



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


JLXL wrote in

Dim MyRange As Excel.Range
Set MyRange = Worksheets("DecisionScores").Range(Cells(3, 2),
Cells(3, 6))

 
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 pivottable object from a range object Grant Excel Programming 2 September 27th 04 02:22 AM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM
Range object to Array object conversion Myrna Larson[_2_] Excel Programming 1 August 1st 03 02:27 AM
Range object to Array object conversion Alan Beban[_3_] Excel Programming 0 August 1st 03 01:24 AM
Range object to Array object conversion Tom Ogilvy Excel Programming 0 August 1st 03 12:16 AM


All times are GMT +1. The time now is 12:39 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"