Hi everyone
I have been teaching myself VBA and have now started coding bigger "Projects". However, I am pretty unfamiliar with code Loops, which is why my codes are pretty insufficient and Long.
I have tried to read and learn how to shorten my specific codes but could unfortunately not find anything. I would therefore be very happy and appreciate it, if someone of the pros could give me a hint on how to shorten the below code.
Thanks a lot in advance and a great day to the Excel community.
----
I have been teaching myself VBA and have now started coding bigger "Projects". However, I am pretty unfamiliar with code Loops, which is why my codes are pretty insufficient and Long.

Thanks a lot in advance and a great day to the Excel community.

----
Code:
'Form 1a
If Worksheets("Pivot_Planogramm").Range("BE6").Formula >= .Range("D31") And Worksheets("Pivot_Planogramm").Range("BE6") <= .Range("E31") And Worksheets("Code").Range("C4") = 1 Then
.Shapes("Form 1a").Fill.ForeColor.RGB = Range("F31").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BE6") >= .Range("D32") And Worksheets("Pivot_Planogramm").Range("BE6") <= .Range("E32") And Worksheets("Code").Range("C4") = 1 Then
.Shapes("Form 1a").Fill.ForeColor.RGB = Range("F32").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BE6") >= .Range("D33") And Worksheets("Pivot_Planogramm").Range("BE6") <= .Range("E33") And Worksheets("Code").Range("C4") = 1 Then
.Shapes("Form 1a").Fill.ForeColor.RGB = Range("F33").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BE6") >= .Range("D34") And Worksheets("Pivot_Planogramm").Range("BE6") <= .Range("E34") And Worksheets("Code").Range("C4") = 1 Then
.Shapes("Form 1a").Fill.ForeColor.RGB = Range("F34").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BE6") >= .Range("D35") And Worksheets("Pivot_Planogramm").Range("BE6") <= .Range("E35") And Worksheets("Code").Range("C4") = 1 Then
.Shapes("Form 1a").Fill.ForeColor.RGB = Range("F35").Interior.Color
Else
.Shapes("Form 1a").Fill.ForeColor.RGB = vbWhite
End If
Code:
'Form 1b
If Worksheets("Pivot_Planogramm").Range("BF6").Formula >= .Range("D31") And Worksheets("Pivot_Planogramm").Range("BF6") <= .Range("E31") Then
.Shapes("Form 1b").Fill.ForeColor.RGB = Range("F31").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BF6") >= .Range("D32") And Worksheets("Pivot_Planogramm").Range("BF6") <= .Range("E32") Then
.Shapes("Form 1b").Fill.ForeColor.RGB = Range("F32").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BF6") >= .Range("D33") And Worksheets("Pivot_Planogramm").Range("BF6") <= .Range("E33") Then
.Shapes("Form 1b").Fill.ForeColor.RGB = Range("F33").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BF6") >= .Range("D34") And Worksheets("Pivot_Planogramm").Range("BF6") <= .Range("E34") Then
.Shapes("Form 1b").Fill.ForeColor.RGB = Range("F34").Interior.Color
ElseIf Worksheets("Pivot_Planogramm").Range("BF6") >= .Range("D35") And Worksheets("Pivot_Planogramm").Range("BF6") <= .Range("E35") Then
.Shapes("Form 1b").Fill.ForeColor.RGB = Range("F35").Interior.Color
Else
.Shapes("Form 1b").Fill.ForeColor.RGB = vbWhite
End If