Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
dot value
I have noted that the MVP members always include .Value when reffering to a cell. eg.
if activecell.value= 5 then for years I would have just used (and have never had any problems) with. if activecell=5 What are the bennifits in specifying "Value"? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
dot value
Stuart,
Invariably, an object has a default property. If you do not specify a property, the default is assumed. I personally try to avoid the default and specify all properties. I find this causes less confusion, is more explanatory, and is likely to cut down on simple errors. As you may have guessed. Value is the default property of the Range object, of which Activecell is an instance. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Stuart" wrote in message ... I have noted that the MVP members always include .Value when reffering to a cell. eg. if activecell.value= 5 then for years I would have just used (and have never had any problems) with. if activecell=5 What are the bennifits in specifying "Value"? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
dot value
Hi
If you don't spesify anything, the default property will be used. For a cell that's Value. So you don't have to use .value to enter a number or a text into a cell. The good thing is that's a good habit, you know what you do and the code is explaining what's happening so you can read and maintain it afterwards without knowing what the default property of just everything might be. You may already know this, but just in case: If you do something like Activecell = Activecell you might think that nothing changes and that you're just confirming where and what the active cell is. Well, not so. Do it in a cell containing a formula and see what happens. -- HTH. Best wishes Harald Followup to newsgroup only please "Stuart" skrev i melding ... I have noted that the MVP members always include .Value when reffering to a cell. eg. if activecell.value= 5 then for years I would have just used (and have never had any problems) with. if activecell=5 What are the bennifits in specifying "Value"? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
dot value
as mentioned, Value is the defualt property, and while it
can be omitted in VB6/VBA, using it does make code more legible. However .NET object have no defualt value. If your current code uses the .Default methods & properties, then it will make re-factoring your code so much easier. Patrick Molloy Microsoft Excel MVP -----Original Message----- I have noted that the MVP members always include .Value when reffering to a cell. eg. if activecell.value= 5 then for years I would have just used (and have never had any problems) with. if activecell=5 What are the bennifits in specifying "Value"? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|