ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Constant definition (https://www.excelbanter.com/excel-programming/323011-constant-definition.html)

DEE

Constant definition
 
The constants such as xlcopy, xlpaste, etc. I understand. However, in trying
to define what a constant is, I'm not as clear.

Is a constant an application (Excel) property? I'm struggling a bit with
properties, objects, etc.
--
Thanks!

Dee

Tom Ogilvy

Constant definition
 
Look in the object browser.

Excel.xlcutcopymode.xlcopy

Library: Excel
Class: xlcutcopymode
Member: xlcopy

I suspose you could call it a property.

demo's from the immediate window:

? Excel.xlcutcopymode.xlcopy
1

--
Regards,
Tom Ogilvy


"dee" wrote in message
...
The constants such as xlcopy, xlpaste, etc. I understand. However, in

trying
to define what a constant is, I'm not as clear.

Is a constant an application (Excel) property? I'm struggling a bit with
properties, objects, etc.
--
Thanks!

Dee




Chip Pearson

Constant definition
 
A constant is nothing more than a name for a number. Constants
are grouped together in related groups called Enums. For example,
the XLWindowState enum contains three member constants:
xlMaximized, xlMinimized, xlNormal. Each of these has a numeric
value, of data type Long.

Constants are not properties.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"dee" wrote in message
...
The constants such as xlcopy, xlpaste, etc. I understand.
However, in trying
to define what a constant is, I'm not as clear.

Is a constant an application (Excel) property? I'm struggling
a bit with
properties, objects, etc.
--
Thanks!

Dee




Tom Ogilvy

Constant definition
 
Chip is absolutely correct. If you thought of them as procedures, it could
"stunt your growth" so to speak - so I was wrong in saying that. You can
also have your own Enums in excel 2000 and later (VBA 6).

Just a slight addendum
A constant is nothing more than a name for a number.


Just to clarify, a constant doesn't have to be a number; example exceptions
such as vbnullstring, vbnullchar and vbBack, part of the Enum vbConstants

And Chip and I have largely been describing intrinsic constants, not all
constants.

Microsoft Excel supports three types of constants:

· Symbolic constants, which you create by using the Const statement and use
in modules.
· Intrinsic constants, which are part of Microsoft Excel/VBA or a referenced
library.
· System-defined constants: True, False, and Null.

--
Regards.
Tom Ogilvy


"Chip Pearson" wrote in message
...
A constant is nothing more than a name for a number. Constants
are grouped together in related groups called Enums. For example,
the XLWindowState enum contains three member constants:
xlMaximized, xlMinimized, xlNormal. Each of these has a numeric
value, of data type Long.

Constants are not properties.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"dee" wrote in message
...
The constants such as xlcopy, xlpaste, etc. I understand.
However, in trying
to define what a constant is, I'm not as clear.

Is a constant an application (Excel) property? I'm struggling
a bit with
properties, objects, etc.
--
Thanks!

Dee






DEE

Constant definition
 
THANK YOU to both of you for clarifying this. It's all quite overwhelming
for a newbie.



"Tom Ogilvy" wrote:

Chip is absolutely correct. If you thought of them as procedures, it could
"stunt your growth" so to speak - so I was wrong in saying that. You can
also have your own Enums in excel 2000 and later (VBA 6).

Just a slight addendum
A constant is nothing more than a name for a number.


Just to clarify, a constant doesn't have to be a number; example exceptions
such as vbnullstring, vbnullchar and vbBack, part of the Enum vbConstants

And Chip and I have largely been describing intrinsic constants, not all
constants.

Microsoft Excel supports three types of constants:

· Symbolic constants, which you create by using the Const statement and use
in modules.
· Intrinsic constants, which are part of Microsoft Excel/VBA or a referenced
library.
· System-defined constants: True, False, and Null.

--
Regards.
Tom Ogilvy


"Chip Pearson" wrote in message
...
A constant is nothing more than a name for a number. Constants
are grouped together in related groups called Enums. For example,
the XLWindowState enum contains three member constants:
xlMaximized, xlMinimized, xlNormal. Each of these has a numeric
value, of data type Long.

Constants are not properties.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"dee" wrote in message
...
The constants such as xlcopy, xlpaste, etc. I understand.
However, in trying
to define what a constant is, I'm not as clear.

Is a constant an application (Excel) property? I'm struggling
a bit with
properties, objects, etc.
--
Thanks!

Dee








All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com