PC Review


Reply
Thread Tools Rate Thread

cells() property?

 
 
Linn Kubler
Guest
Posts: n/a
 
      23rd Mar 2010
Hi,

I'm confused. I'm working with Excel 2003 and trying to manipulate cells on
a worksheet. Looking at the Excel 2003 VB Reference documentation I see
examples like the following:

Worksheets("Sheet1").Cells(5, 3).Font.Size = 14
Worksheets("Sheet1").Cells(1).ClearContents

Now to me that means that Cells() is an object because it has properties,
..Font.Size, and methods, .ClearContents. However, in the documentation all
I can find is a Cells property, how can this be?

What I would like to do is find a listing of all the "properties", "methods"
and "events" of the Cells property. How do I go about changing font color,
size, cell shading, borders and what-not of a cell?

Like I said, I'm a bit confused.

Thanks in advence,
Linn


 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      23rd Mar 2010
Hi Linn,
You are not the first to be confused by this!
Cells is a Property of the Range object
Range.Cells(1,1) can be shortened to Cells(1,1) but the latter still
represents a Range property.

I Googled "Excel VBA Cells" and found some site that might help you. One of
them s
http://www.anthony-vba.kefra.com/vba/vbabasic2.htm

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Linn Kubler" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm confused. I'm working with Excel 2003 and trying to manipulate cells
> on a worksheet. Looking at the Excel 2003 VB Reference documentation I
> see examples like the following:
>
> Worksheets("Sheet1").Cells(5, 3).Font.Size = 14
> Worksheets("Sheet1").Cells(1).ClearContents
>
> Now to me that means that Cells() is an object because it has properties,
> .Font.Size, and methods, .ClearContents. However, in the documentation
> all I can find is a Cells property, how can this be?
>
> What I would like to do is find a listing of all the "properties",
> "methods" and "events" of the Cells property. How do I go about changing
> font color, size, cell shading, borders and what-not of a cell?
>
> Like I said, I'm a bit confused.
>
> Thanks in advence,
> Linn
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      23rd Mar 2010
Cells is an object, but an object can be a property of another object. Range
can be a property of Range!

--

HTH

Bob

"Linn Kubler" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm confused. I'm working with Excel 2003 and trying to manipulate cells
> on a worksheet. Looking at the Excel 2003 VB Reference documentation I
> see examples like the following:
>
> Worksheets("Sheet1").Cells(5, 3).Font.Size = 14
> Worksheets("Sheet1").Cells(1).ClearContents
>
> Now to me that means that Cells() is an object because it has properties,
> .Font.Size, and methods, .ClearContents. However, in the documentation
> all I can find is a Cells property, how can this be?
>
> What I would like to do is find a listing of all the "properties",
> "methods" and "events" of the Cells property. How do I go about changing
> font color, size, cell shading, borders and what-not of a cell?
>
> Like I said, I'm a bit confused.
>
> Thanks in advence,
> Linn
>



 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      23rd Mar 2010
Cells is not an object type in and of itself (e.g., you can't declare
a variable of type Cells). It is simply a property of a Range object
that returns (another) Range object. As such, it doesn't have
properties of methods itself. Since it is a Range object, it has the
same properties and methods of a Range.

Any operation that can carried out on a "normal" Range can be done
with the Range returned by Cells.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Tue, 23 Mar 2010 08:44:08 -0500, "Linn Kubler"
<(E-Mail Removed)> wrote:

>Hi,
>
>I'm confused. I'm working with Excel 2003 and trying to manipulate cells on
>a worksheet. Looking at the Excel 2003 VB Reference documentation I see
>examples like the following:
>
>Worksheets("Sheet1").Cells(5, 3).Font.Size = 14
>Worksheets("Sheet1").Cells(1).ClearContents
>
>Now to me that means that Cells() is an object because it has properties,
>.Font.Size, and methods, .ClearContents. However, in the documentation all
>I can find is a Cells property, how can this be?
>
>What I would like to do is find a listing of all the "properties", "methods"
>and "events" of the Cells property. How do I go about changing font color,
>size, cell shading, borders and what-not of a cell?
>
>Like I said, I'm a bit confused.
>
>Thanks in advence,
>Linn
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
using the cells property for use with Application.WorksheetFunction.Sum EAB1977 Microsoft Excel Programming 2 27th May 2010 08:20 PM
using cells property bigjim Microsoft Excel Programming 2 13th Feb 2010 01:47 PM
How do I use the .Cells property to refer to ActiveCell? Caeres Microsoft Excel Misc 9 7th Oct 2008 02:56 PM
cells property =?Utf-8?B?U291cmlz?= Microsoft Excel Programming 1 18th Aug 2005 07:50 PM
Delete cells with a certain property jmatchus Microsoft Excel Programming 7 15th Mar 2004 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:03 AM.