You've made this code very complicated. The main problem with it is copying and pasting cells (their formats).
Staying in the convention of your code, see how it shortened. Execution time too. :-)
Sub Painting_Dept_Identifier_1()
Dim start_Time#, End_Time#
Dim rngDefinedColors As Range
Main_Order_No_Col = Range("Main_Order_Col").Column
Main_Dept_Col = Range("main_line_Number").Column
Main_Line_Column = Range("Main_Line_Number_02").Column
Main_Header_Row = Range("planning_header_row").Row + 2
'>>>Reading data from loading Zones
Row_Start = Range("Loading_Zones").Row
Column_Start = Range("Loading_Zones").Column
Column_End = Column_Start + Range("Loading_Zones").Columns.Count - 1
loading_Zones_row = Range("Loading_Zones").Row
'>>> doing the loop to place the color 1st on the loading data sheet
KL_Row_Index = Main_Header_Row
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
End With
start_Time = Timer
'Range("Loading_Zones").ClearFormats
Set rngDefinedColors = Worksheets("Lines").Range("C2:C30")
Application.StatusBar = "Planning Calculation : Painting In Progress"
Do While Range("Main!A1").Offset(KL_Row_Index - 1, Main_Order_No_Col - 1) <> ""
Group_Identifier = Range("Main!A1").Offset(KL_Row_Index - 1, Main_Dept_Col - 1)
Range("Main!A1").Offset(KL_Row_Index - 1, Main_Dept_Col - 1).Interior.Color = rngDefinedColors.Cells(Group_Identifier).Interior.Color
Range("Main!A1").Offset(KL_Row_Index - 1, Main_Line_Column - 1).Interior.Color = rngDefinedColors.Cells(Group_Identifier).Interior.Color
For Column_Index = Column_Start To Column_End
'>>>> LOOP WHEN ZERO VALUES FOR EFFICIENT COLORING
If Range("Main!A1").Offset(KL_Row_Index - 1, Column_Index - 1) = 0 Then
GoTo Skip_Column
End If
'>>>>>>>>>>>>>>> Identify the group to color and start setting the colors on the loading zones of each _
order and row.
Group_Identifier = Range("Main!A1").Offset(KL_Row_Index - 1, Main_Dept_Col - 1)
Range("Main!A1").Offset(KL_Row_Index - 1, Column_Index - 1).Interior.Color = rngDefinedColors.Cells(Group_Identifier).Interior.Color
SKIP_ROW:
Skip_Column:
Next Column_Index
'loading_Zones_row = loading_Zones_row + 1
KL_Row_Index = KL_Row_Index + 1
Loop
'
' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
' , AllowFormattingCells:=True, AllowFormattingColumns:=True, _
' AllowFormattingRows:=True, AllowDeletingRows:=True, AllowSorting:=True, _
' AllowFiltering:=True
'Sheets("Master_Visual").Range("MVisual_Str") = "Y"
End_Time = Timer
Application.StatusBar = " Painting Completed In " & Format(End_Time - start_Time, "0.000") & "secs"
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
End With
End Sub
And that's not the optimal code yet. But maybe that's enough for you.
Artik