I found the solution from a very old thread on mr excel forum.

If you have very long code in VBA, you will need to separate it.
Your first part of the code you will have it start with something like: Private Sub Worksheet_Change_A(ByVal Target As Range)
Then separate the second part of the code with: Private Sub Worksheet_Change_B(ByVal Target As Range)

Then at the very top add:
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheet_Change_A Target
Worksheet_Change_B Target
End Sub

Don't forget to add an End Sub after your first part of your code.