Fading LED without Delay

Hello,

I stuck with the millis counter, which I want to use instead of the Dealy (20) on the end.
I searched the Web and the Forum.

I hope somebody can help me to replace the "Delay" on the end.
I'll try again.

  int reading1 = digitalRead(btnPinS1);
  if (reading1 != lastBtnStateS1)
  {
    lastDebounceTime = millis();
  }
    if ((millis() - lastDebounceTime) > debounceDelay)
    {

    if (reading1 != btnStateS1)
    {
      btnStateS1 = reading1;

     if (btnStateS1 == HIGH)
      {
        ledState1 = !ledState1;
      }
    }
  }

if (ledState1 == HIGH && pwmC1 >= 0 && pwmC1 <= 254)
  {
    pwmC1 = pwmC1 +5;
    delay(20);
  }
if (ledState1 == LOW && pwmC1 >= 1 && pwmC1 <= 256)
  {
    pwmC1 = pwmC1 -5;
    delay(20);
  }
if (ledState1 == HIGH && pwmC1 >= 0 && pwmC1 <= 254)
  {
    pwmC1 = pwmC1 +5;
    delay(20);
  }
if (ledState1 == LOW && pwmC1 >= 1 && pwmC1 <= 256)
  {
    pwmC1 = pwmC1 -5;
    delay(20);
  }

Add new variable: eg. long allowchange;
new code:

if(millis()>=allowchange)
{
  allowchange+=20; //add 20 ms
  if (ledState1 == HIGH && pwmC1 >= 0 && pwmC1 <= 254)   pwmC1 = pwmC1 +5;
  if (ledState1 == LOW && pwmC1 >= 1 && pwmC1 <= 256)    pwmC1 = pwmC1 -5;
 }
}

also take a close look at those last if's

Partial code isn't helpful, we can't see all the declarations and so forth - post the entire
sketch please.