I'm guessing that it's because you have a Sub declared within a Sub declared within a Sub
I'm further guessing that you meant to call the second and third level subs
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("D22")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
DoWhile_Loop '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< call to sub
End If
End Sub
Sub DoWhile_Loop()
Do While Range("X22").Value <> Range("Y22").Value
insertRowFormatFromAbove '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< call to sub
Loop
End Sub
Sub insertRowFormatFromAbove()
Worksheets(ActiveSheet.Name).Rows(27).Insert Shift:=xlShiftDown
End Sub