I can see no particular reason the code would not work but have moved the LED off code out of switch/default and removed it as this may have been confusing matters, I have also changed int to unsigned long and added serial print code to aid debugging. Can you please try it again and let me know what happens.
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led7 = 7;
int led8 = 8;
void setup()
{
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
}
void loop() {
unsigned long lastValue;
if (irrecv.decode(&results)) { // Check for IR button press
unsigned long newValue = results.value; // Get IR code
if (newValue == 0xffffffff) { // NEC repeat button pressed?
newValue = lastValue; // Substitute last not repeat code
}
else { // Not repeat code
lastValue = newValue; // Store last not repeat code
}
switch (newValue) {
case 2011287691:
//do something when var equals 1
digitalWrite(led7, HIGH);
Serial.println("LED7");
delay(50);
break;
case 2011279499:
//do something when var equals 2
digitalWrite(led8, HIGH);
Serial.println("LED8");
delay(50);
break;
}
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
irrecv.resume(); // Receive the next value
}
}