Hi all,

Just interested in a bit of discussion at the moment. I've got a portion of my code which reads settings (Variable = Cell) to store them for later use.

Problem is, I've defined each variable 1 at a time. Now, that's all well and good, but I'm sure there must be a better, more streamlined way of doing things.

The flow on effect is, if I'm able to streamline this section of code, I can likely turn some other sections into arrays as well.

The thought that did occur to me would be to store the cell rows / columns in an array, and then use that to get the cell positions...

E.g.

SettingsArray(iteration) = Sheets("Settings").Cells(LocationArray(Row),LocationArray(Column))
The actual code I'm currently using is...

Dim LODGE1, LODGE2, INCDATE1, INCDATE2, BCODE, PCODE, INCTYPE, CCODE, DCODE, INCSTATE, INCTOWN, CACID, CMGR, CSTATUS, ADJ, CN1, CN2, INCSTATUS, CISU, AG1, AG2, AG3, DISCODE As String

'Read Values from Settings... No way to Array this...?

LODGE1 = Sheets("Settings").Cells(4, 3)
LODGE2 = Sheets("Settings").Cells(4, 5)
INCDATE1 = Sheets("Settings").Cells(5, 3)
INCDATE2 = Sheets("Settings").Cells(5, 5)
BCODE = Sheets("Settings").Cells(6, 3)
PCODE = Sheets("Settings").Cells(6, 4)
INCTYPE = Sheets("Settings").Cells(7, 3)
CCODE = Sheets("Settings").Cells(8, 3)
DCODE = Sheets("Settings").Cells(9, 3)
INCSTATE = Sheets("Settings").Cells(10, 3)
INCTOWN = Sheets("Settings").Cells(11, 3)
CACID = Sheets("Settings").Cells(12, 3)
CMGR = Sheets("Settings").Cells(13, 3)
CSTATUS = Sheets("Settings").Cells(14, 3)
ADJ = Sheets("Settings").Cells(15, 3)
CN1 = Sheets("Settings").Cells(16, 3)
CN2 = Sheets("Settings").Cells(16, 5)
DMCode = Sheets("Settings").Cells(17, 3)
INCSTATUS = Sheets("Settings").Cells(18, 3)
CISU = Sheets("Settings").Cells(19, 3)
AG1 = Sheets("Settings").Cells(20, 3)
AG2 = Sheets("Settings").Cells(20, 4)
AG3 = Sheets("Settings").Cells(20, 5)
DISCODE = Sheets("Settings").Cells(21, 3)
Any thoughts / comments are greatly appreciated.

-Bob