We will have the following:
[tex]\begin{gathered} \frac{x^2-kx+24}{x-12}=x-2\Rightarrow x^2-kx+24=(x-2)(x-12) \\ \\ \Rightarrow x^2-kx+24=x^2-12x-2x+24 \\ \\ \Rightarrow x^2-kx+24=x^2-14x+24 \\ \\ \Rightarrow-kx=-14x\Rightarrow k=14 \end{gathered}[/tex]So, the value of k will be 14.