Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi,
is there any difference between these two codes? for example: set curCell=sheets("sheet1").cells(1,3) and curCell=sheets("sheet1").cells(1,3) I'd like to know why sometimes "set" is used at the beginning of codes? thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Those two statements are very different. The first statement creates a range
object that references cell C1. The second statement fills a variable with the contents of cell C1. The Set statement is used to create or modify objects. Basically telling your sytem to point to an object like a range or a worksheet or workbook. With that reference I can access all of the properties and methods of that object. Your second statement fills a variable with the contents of the cell. By default a cell returns its value unless you specify otherwise. -- HTH... Jim Thomlinson "peyman" wrote: hi, is there any difference between these two codes? for example: set curCell=sheets("sheet1").cells(1,3) and curCell=sheets("sheet1").cells(1,3) I'd like to know why sometimes "set" is used at the beginning of codes? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB Codes | Excel Discussion (Misc queries) | |||
Help with codes please!! | Excel Discussion (Misc queries) | |||
ZIP CODES | Excel Worksheet Functions | |||
Zip Codes | Excel Discussion (Misc queries) | |||
Zip Codes | Excel Discussion (Misc queries) |