Shortening repetitive code/pin definitions

I have a project (which is to long to fit here) and it has a lot of repetitive code, samples below. How would I simplify that. The pins will always be sequential, but may change start position.

Thanks, Branyon

const int Relay_A = 22;
const int Relay_B = 23;
const int Relay_C = 24;
const int Relay_D = 25;
const int Relay_E = 26;
const int Relay_F = 27;
const int Relay_G = 28;
const int Relay_H = 29;
const int Relay_I = 30;
const int Relay_J = 31;
const int Relay_K = 32;
const int Relay_L = 33;
const int Relay_M = 34;
const int Relay_N = 35;
const int Relay_O = 36;
const int Relay_P = 37;

byte Relay_A_State = LOW;
byte Relay_B_State = LOW;
byte Relay_C_State = LOW;
byte Relay_D_State = LOW;
byte Relay_E_State = LOW;
byte Relay_F_State = LOW;
byte Relay_G_State = LOW;
byte Relay_H_State = LOW;
byte Relay_I_State = LOW;
byte Relay_J_State = LOW;
byte Relay_K_State = LOW;
byte Relay_L_State = LOW;
byte Relay_M_State = LOW;
byte Relay_N_State = LOW;
byte Relay_O_State = LOW;
byte Relay_P_State = LOW;

unsigned long Previous_Relay_A_Millis = 0;
unsigned long Previous_Relay_B_Millis = 0;
unsigned long Previous_Relay_C_Millis = 0;
unsigned long Previous_Relay_D_Millis = 0;
unsigned long Previous_Relay_E_Millis = 0;
unsigned long Previous_Relay_F_Millis = 0;
unsigned long Previous_Relay_G_Millis = 0;
unsigned long Previous_Relay_H_Millis = 0;
unsigned long Previous_Relay_I_Millis = 0;
unsigned long Previous_Relay_J_Millis = 0;
unsigned long Previous_Relay_K_Millis = 0;
unsigned long Previous_Relay_L_Millis = 0;
unsigned long Previous_Relay_M_Millis = 0;
unsigned long Previous_Relay_N_Millis = 0;
unsigned long Previous_Relay_O_Millis = 0;
unsigned long Previous_Relay_P_Millis = 0;

void setup() {
  pinMode(Relay_A, OUTPUT);
  pinMode(Relay_B, OUTPUT);
  pinMode(Relay_C, OUTPUT);
  pinMode(Relay_D, OUTPUT);
  pinMode(Relay_E, OUTPUT);
  pinMode(Relay_F, OUTPUT);
  pinMode(Relay_G, OUTPUT);
  pinMode(Relay_H, OUTPUT);
  pinMode(Relay_I, OUTPUT);
  pinMode(Relay_J, OUTPUT);
  pinMode(Relay_K, OUTPUT);
  pinMode(Relay_L, OUTPUT);
  pinMode(Relay_M, OUTPUT);
  pinMode(Relay_N, OUTPUT);
  pinMode(Relay_O, OUTPUT);
  pinMode(Relay_P, OUTPUT);
}

arrays:

const byte RelayPins [] = {22,23,24,25,26,28.29,30,31,32,33,34,35,36,37,};


byte RelayState [] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,};

unsigned long PreviousRelayMillis[16];

byte x;

void setup(){
for (x=0; x<16; x=x+1){
pinMode (RelayPins[x], OUTPUT);
}

Or…

const int firstPin = 23;
const int numPins = 15;

...

    for (int pin=firstPin; pin<firstPin+numPins; pin++)
        pinMode(pin, OUTPUT);

Regards,
Ray L.

If you still want to name individual pins, as in your

const int Relay_A = 22;
const int Relay_B = 23;
const int Relay_C = 24;
//... etc. up to
const int Relay_P = 37;

as long as they are consecutive, you can also batch initialize them:

const int numPins = Relay_P - Relay_A + 1;

setup() {
for (int x=0; x<numPins; x=x+1){
pinMode (Relay_A+x, OUTPUT);
}
//...

or better…

setup() {
for (int pin=RelayA; pin<=Relay_P; pin=pin+1){
pinMode (pin, OUTPUT);
}
//...