Tuesday 20 August 2019

MS Excel : Add quotes to Your Cells in Excel Automatically

How to Add Quotes to Your Cells in Excel Automatically



This tip is going to be mostly helpful to people who working with databases. But, if you work with Excel and find yourself needing to deal with repetitive formatting, you might also appreciate the technique.
When working with CSV files you may need to add quotes to either side of a cell’s contents in order to upload them properly to your database. You can easily find yourself working with an Excel file from a workmate that needs to be formatted.
You got this:
But really need this:
This can be a big damn deal if you have hundreds of fields. No one wants to add this by hand. Fortunately, the solution is a snap! It all has to do with applying specific formatting to your cells.
  • Highlight the cells you want to add the quotes.
  • Go to Format –> Cells –> Custom
  • Copy/Paste the following into the Type field: \”@\”
  • Click “okay”
  • Be happy you didn’t do it all by hand.
NOTE: It’s always a good idea to open your file in a text editor to double-check your CSV export. Sometimes you need to do a little find/replace action to get your file picture perfect.

========== Second =======

I have found that the concatenate function I have used to add single quotes and a comma to a column of text is no longer working. I need this to bring a series of IDs into a SQL query.

By using following, i was able to achieve desired output.
Basically, it is an alternative to =concatenate():

="'"&A1&"',"

No comments:

Post a Comment