Thread: syntax question
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default syntax question

jim:

why does this work
Application.Sum(Range(ws4.Cells(2, x), ws4.Cells(lRow, x)))
and this doesn't
Application.Sum(ws4.Range(Cells(2, x),Cells(lRow, x)))

--


Gary


"Jim Cone" wrote in message
...

Gary,
If the ActiveSheet is ws3 both will work.
If the ActiveSheet is some other sheet both will blow up.
I guess in that regard they both function the same. <g

The preferred method is to prefix Range and Cells with the
worksheet...
ws3.Range(ws3.Cells(2, x), ws3.Cells(lRow, x))
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Gary Keramidas" <GKeramidasATmsn.com
wrote in message
just wondering if these are functionally the same:

i = Range(ws3.Cells(2, x), ws3.Cells(lRow, x))
i = ws3.Range(Cells(2, x), Cells(lRow, x))

--


Gary