How do I make my potentiometer increase the sound of the buzzer?

For some background, I am extremely new to arduino and coding in general, I also am trying to make a 2 inputs, 2 outputs code. The inputs are the button and the potentiometer. Outputs are the LEDs and the buzzer. I have figured out what I need for the button and LEDs, but I need help changing the code at the second half to make the buzzer louder at different intervals of the potentiometer changing (if that makes sense?). I have LEDs changing speed in that section at the moment, so if someone could help me change it to a buzzer changing in volume?

My code:

int sensorPin =A5;
int led1 = 13;
int led2 = 12;
int led3 = 11;
int led4 = 10;
int led5 = 9;
int led6 = 8;
int button = 7;
int sensorValue= 0;

void setup () {

pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(button, INPUT);
Serial.begin(9600);
}

void loop () {

if(digitalRead(button)==HIGH){
digitalWrite(led1, HIGH);
delay(200);
digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);
delay(200);
digitalWrite(led2, LOW);

digitalWrite(led3, HIGH);
delay(200);
digitalWrite(led3, LOW);

digitalWrite(led4, HIGH);
delay(200);
digitalWrite(led4, LOW);

digitalWrite(led5, HIGH);
delay(200);
digitalWrite(led5, LOW);

digitalWrite(led6, HIGH);
delay(200);
digitalWrite(led6, LOW);
}
{
sensorValue =analogRead(sensorPin);
if ((sensorValue > 0) && (sensorValue <170)) {
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
delay(sensorValue);
} else {
if ((sensorValue > 170) && (sensorValue <340)) {
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
delay(sensorValue);
} else {
if ((sensorValue > 340) && (sensorValue <510)) {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
delay(sensorValue);
} else {
if ((sensorValue > 510) && (sensorValue <680)) {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
delay(sensorValue);
} else {
if ((sensorValue > 680) && (sensorValue <850)) {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led3, LOW);
delay(sensorValue);
} else {
if ((sensorValue > 850) && (sensorValue <1023)) {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, LOW);
digitalWrite(led3, HIGH);
delay(sensorValue);
}
}
}
}
}
}
}
}

Your code is flawed. What happens if sensorValue == 850, for example?

Also, you talk about a buzzer, but there isn't any buzzer code in the sketch. So how can we possibly make it quiet and loud? Please at least include code to make the buzzer buzz. Even once.

I want to change the led to a buzzer. And then figure out how to make the buzzer increase in volume

Please try. What buzzer do you have? Changing the name from LED to buzzer on the pin you intend to use, would be a good start and it's easy.

I have the piezo buzzer, if that's what you mean?

please edit your first post, select the code part and press the </> icon in the tool bar to mark it as code. It's barely readable as it stands. (also make sure you indented the code in the IDE before copying, that's done by pressing ctrlT on a PC or cmdT on a Mac)

--

(and please read How to get the best out of this forum).

You have to post all the relevant information that you have. It's not fun begging. What piezo buzzer? Have a link to that?

Have you done anything at all with the buzzer? Like tried connecting it and making it buzz?