Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just a hint on how Excel and VBA manage ranges: There is never a zero
cell! Item(0) is 1 less than Item(1) and so if $C$9 is the 1st cell (ie: Trips.Cells(1).Address) then it makes sense that Item(0) (ie: Trips.Cells(-1).Address) is evaluated as $C$8! When you dump a range into a variant you result a 2D array that is 1 based... Dim vData As Variant vData = Range("$C$9:$C$58") ...which results to vData having 50 rows and 1 column, which is the same as... Dim vData(1 To 50, 1 To 1) ...because there is no Row0 or Col0. Had your range started at $C$1 instead of $C$9 then Item(0) would either evaluate to ref the last cell in ColB --OR-- throw an exception. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |