View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default SET statement tutorial

If the variable represents an object (a range, a worksheet, a workbook, a
collection, a...), then you need Set.

If the variable represents a simple thingy (an integer, a string, a boolean,
a....), then you don't use Set.

If the variable has properties or methods, you know that it needs Set.

Dim wks as Worksheet

Search for Worksheet in VBA's help and you'll see all the properties and
methods.

====
Well, I can't think of an example that uses a simple variable that breaks this
rule of thumb. Maybe someone will post an example correcting me.

Daminc wrote:

Oh, and another thing.

What would the SET statement be used for in a practical sense.

I would really appreciate it if someone could actually explain it in
terms that I can understand rather than assuming I know everything
before hand like all the bl**dy tutorials that I've found

--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=501108


--

Dave Peterson