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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

OdinsDream

Well-known Member
Joined
May 19, 2002
Messages
541
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)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,821
Messages
5,766,639
Members
425,364
Latest member
jstubs99

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
Top