Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mel mel is offline
external usenet poster
 
Posts: 6
Default Empty keyword in statment Application.caption?

I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Empty keyword in statment Application.caption?

Personally, I have found little in the help to indicate that "empty" is a
key word.

If empty isn't declared as a variable or is declared as Variant and never
initialized, then it would represent the value of an uninitialized variable.
Used in the context you show, it would be equivalent to a null string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Empty keyword in statment Application.caption?

Empty is a keyword indicating that a Variant type variable has no
contents. E.g.,

Dim V As Variant
Debug.Print V = Empty
V = 123
Debug.Print V = Empty
V = Empty
Debug.Print V = Empty


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



"Tom Ogilvy" wrote in message
...
Personally, I have found little in the help to indicate that

"empty" is a
key word.

If empty isn't declared as a variable or is declared as Variant

and never
initialized, then it would represent the value of an

uninitialized variable.
Used in the context you show, it would be equivalent to a null

string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Empty keyword in statment Application.caption?

substitute Horseradish for empty and see if you don't get the same result.

Sub Tester2()
Dim V As Variant
Debug.Print V = HorseRadish
V = 123
Debug.Print V = HorseRadish
V = HorseRadish
Debug.Print V = HorseRadish
End Sub

gives the same result for me.

If you have a reference, please post it.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
Empty is a keyword indicating that a Variant type variable has no
contents. E.g.,

Dim V As Variant
Debug.Print V = Empty
V = 123
Debug.Print V = Empty
V = Empty
Debug.Print V = Empty


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



"Tom Ogilvy" wrote in message
...
Personally, I have found little in the help to indicate that

"empty" is a
key word.

If empty isn't declared as a variable or is declared as Variant

and never
initialized, then it would represent the value of an

uninitialized variable.
Used in the context you show, it would be equivalent to a null

string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Empty keyword in statment Application.caption?

From VBA's help in xl2002:

Empty
The Empty keyword is used as a Variant subtype. It indicates an uninitialized
variable value.


It even turns blue like "if" and "then".


Tom Ogilvy wrote:

substitute Horseradish for empty and see if you don't get the same result.

Sub Tester2()
Dim V As Variant
Debug.Print V = HorseRadish
V = 123
Debug.Print V = HorseRadish
V = HorseRadish
Debug.Print V = HorseRadish
End Sub

gives the same result for me.

If you have a reference, please post it.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
Empty is a keyword indicating that a Variant type variable has no
contents. E.g.,

Dim V As Variant
Debug.Print V = Empty
V = 123
Debug.Print V = Empty
V = Empty
Debug.Print V = Empty


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



"Tom Ogilvy" wrote in message
...
Personally, I have found little in the help to indicate that

"empty" is a
key word.

If empty isn't declared as a variable or is declared as Variant

and never
initialized, then it would represent the value of an

uninitialized variable.
Used in the context you show, it would be equivalent to a null

string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "





--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Empty keyword in statment Application.caption?

Since you're not using Option Explicit, VBA creates a new variant
variable called HorseRadish of subtype, yes, Empty (VarType() =
vbEmpty =0).


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


"Tom Ogilvy" wrote in message
...
substitute Horseradish for empty and see if you don't get the

same result.

Sub Tester2()
Dim V As Variant
Debug.Print V = HorseRadish
V = 123
Debug.Print V = HorseRadish
V = HorseRadish
Debug.Print V = HorseRadish
End Sub

gives the same result for me.

If you have a reference, please post it.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
Empty is a keyword indicating that a Variant type variable

has no
contents. E.g.,

Dim V As Variant
Debug.Print V = Empty
V = 123
Debug.Print V = Empty
V = Empty
Debug.Print V = Empty


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



"Tom Ogilvy" wrote in message
...
Personally, I have found little in the help to indicate

that
"empty" is a
key word.

If empty isn't declared as a variable or is declared as

Variant
and never
initialized, then it would represent the value of an

uninitialized variable.
Used in the context you show, it would be equivalent to a

null
string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in

message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Empty keyword in statment Application.caption?

Or declaring it as a variant would achieve the same.

As Dave said, it is highlighted in Blue, so I guess VBA does see it as a
keyword, but it seems of limited utility except for "documentation".

--
Regards,
Tom Ogilvy


"Chip Pearson" wrote in message
...
Since you're not using Option Explicit, VBA creates a new variant
variable called HorseRadish of subtype, yes, Empty (VarType() =
vbEmpty =0).


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


"Tom Ogilvy" wrote in message
...
substitute Horseradish for empty and see if you don't get the

same result.

Sub Tester2()
Dim V As Variant
Debug.Print V = HorseRadish
V = 123
Debug.Print V = HorseRadish
V = HorseRadish
Debug.Print V = HorseRadish
End Sub

gives the same result for me.

If you have a reference, please post it.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
Empty is a keyword indicating that a Variant type variable

has no
contents. E.g.,

Dim V As Variant
Debug.Print V = Empty
V = 123
Debug.Print V = Empty
V = Empty
Debug.Print V = Empty


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



"Tom Ogilvy" wrote in message
...
Personally, I have found little in the help to indicate

that
"empty" is a
key word.

If empty isn't declared as a variable or is declared as

Variant
and never
initialized, then it would represent the value of an
uninitialized variable.
Used in the context you show, it would be equivalent to a

null
string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in

message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing with Keyword Nam Excel Discussion (Misc queries) 0 April 28th 06 05:27 AM
Textbox.caption to cell if empty, how? WTG Excel Worksheet Functions 1 February 27th 05 09:30 AM
Textbox.caption to cell if empty, how? WTG Excel Discussion (Misc queries) 2 February 27th 05 04:03 AM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
Default Application.caption Soniya Excel Programming 1 August 12th 03 01:18 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"