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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

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)
 

Forum statistics

Threads
1,148,275
Messages
5,745,799
Members
423,974
Latest member
highvoltageacdc

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