Can you create a Constant array

deadseasquirrels

Board Regular
Joined
Dec 30, 2004
Messages
232
Is it possible to establish a constant array that holds, say email addresses, to be used later on for automatic mailing functions? I could always just embed the array within the function, but i figured having the array sitting outside the function would be easier to manipulate if I end up adding and deleting names on a regular basis. Also I don't want to put the email addresses in another sheet, I'm trying to have it as self-contained as possible. Thanks.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I have an array that I declare like this:

Public Entries(1 To 15, 7 To 23) As String

and then I fill it with a subroutine before my others run, called FillEntriesArray() which does something like:

Entries(1, 7) = "(X)"
Entries(2, 15) = "X"
.... and so on.

You can also use arrays directly with the Array function, like so:

For Each Entry in Array(1,2,3,4,5)
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top