ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create a Private Const Array in excel 2000 (https://www.excelbanter.com/excel-programming/428814-create-private-const-array-excel-2000-a.html)

[email protected]

Create a Private Const Array in excel 2000
 
Hi,

Just wondering if it is possible to create a private constant array of
type string in excel 2000.

I want this constant string array to sit at the top of my module and
be used in the subs that follow.

Regards,
Tom


Jim Cone[_2_]

Create a Private Const Array in excel 2000
 
This is as close as I can come. It doesn't appear to be very efficient...
'--
Option Explicit
Private Const sNames As String = "Larry,Moe,Curly"

Sub Demo()
MsgBox Split(sNames, ",")(1) 'returns Moe
End Sub

--
Jim Cone
Portland, Oregon USA




wrote in message
Hi,
Just wondering if it is possible to create a private constant array of
type string in excel 2000.
I want this constant string array to sit at the top of my module and
be used in the subs that follow.
Regards,
Tom


[email protected]

Create a Private Const Array in excel 2000
 
On May 22, 1:19*pm, "Jim Cone" wrote:
This is as close as I can come. *It doesn't appear to be very efficient....
'--
Option Explicit
Private Const sNames As String = "Larry,Moe,Curly"

Sub Demo()
* MsgBox Split(sNames, ",")(1) 'returns Moe
End Sub

--
Jim Cone
Portland, Oregon *USA


wrote in message
Hi,
Just wondering if it is possible to create a private constant array of
type string in excel 2000.
I want this constant string array to sit at the top of my module and
be used in the subs that follow.
Regards,
Tom


Perfect - thanks.


All times are GMT +1. The time now is 01:43 PM.

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