Whenever I paste SQL code it automatically colours it. Like this:

Example of SQL coding

Which is great. However, I don't like how it separates the lines of code into different rows. But when I try and paste the code into one cell, it loses its colouring:


Is there any way to keep the code in one cell, while also keeping the colouring?

  • Copy/paste formatting? The little icon that looks like a paintbrush ... – Mawg says reinstate Monica Jan 2 '19 at 10:50
  • As Mawg said, paste with source formatting right than paste with target formatting. – spikey_richie Jan 2 '19 at 10:54
  • Where is the paintbrush icon – klippy Jan 2 '19 at 11:07
  • Excel is quite limited in terms of different formatting within cells. You might succeed using this workaround: superuser.com/a/1029030/427317 – Máté Juhász Jan 2 '19 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.