..Value does not apply just to the top left cell
Sub test()
Range("A1:A10").Value = 10
End Sub
Sub test2()
Dim varTemp As Variant
varTemp = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Range("A1:A10").Value = Application.Transpose(varTemp)
End Sub
"Stefano Gatto" wrote:
> Yes, I saw that right after having posted my question... The class is range
> and .Value applies to the most top-left cell I imagine.
> --
> Stefano Gatto
>
>
> "Jim Rech" wrote:
>
> > There is no Cell class. There is a Range object that includes one or more
> > cells.
> >
> > >>Is there a real difference?
> >
> > The real difference is in reading a cell.
> >
> > Jim
> > "Stefano Gatto" <(E-Mail Removed)> wrote in message
> > news:02F293F8-D4DB-4CD7-91A4-(E-Mail Removed)...
> > > One question I have on the Cell class of Excel...
> > >
> > > Which property is better to assign when you need to programmatically write
> > > something in a cell?
> > >
> > > Formula or Value?
> > >
> > > Should this choice be made on the nature of what we want to store in a
> > > cell.
> > > In other words, if we want to store 56 then it's better to assign the
> > > .Value
> > > property and when we want to assign =34+69 or =$A$3^3 then it's better to
> > > use
> > > .Formula instead?
> > >
> > > Ok, but then why not consistently use the .Formula property then? .Formula
> > > works in all cases (e.g. ActiveSheet.Cells(1).Formula = 98 perfectly
> > > works),
> > > but I keep on reading in web sites and manuals that .Value is used
> > > instead.
> > >
> > > Is there a real difference?
> > >
> > > My personal preference would be that .Formula is read/write and can be
> > > assigned. Value would be readonly and is calculated by Excel exclusively,
> > > as
> > > a result of the cell's Formula.
> > >
> > > Thank you.
> > > Stefano Gatto
> >
> >
|