Formatting when copying SQL data and pasting in Excel - sql

I want to copy a sql result set and paste it in Excel. But the data I paste in to the spreadsheet doesn't want to recognize Excel formatting. So if I change a column to currency, it doesn't do anything. But...if I double click on a cell, THEN it applies the currency format. But only to that cell.
How can I make it automatically recognize the Excel format?
I must be something I'm missing. Hopefully somebody can help. :-)

After you input the data into the columns in Excel, highlight all cells, then select the Data tab in the top ribbon. In the data tab click on Text to Columns, in the pop-up window select Delimited, then uncheck all of the boxes in Step 2 on that pop-up and select Finish. It will force all of the cells to update to your formatting.

Have you tried <edit><paste special> and then paste the data as text? Otherwise you're copying data AND formatting, which might be the problem.

You can right click on the SQL Grid and pick the the Save Results As option and save as csv. Open the csv in excel copy the content and paste in your destination Excel worksheet.

Seconding the <edit><paste special>, but another useful feature is <Text to Columns>. So if you paste your data as text, if it does not automatically appear in columns, use the Text to Columns to turn it into columns, then any formatting you apply should work.

Change your excel column format into text and then paste special -> TEXT

Related

Teradata SQL Concatenates Columns when Pasting to Excel

I have my SQL output as five columns. When I paste the SQL output to Excel it seems to concatenate everything that is a string into one column until a number appears.
In this case, my first 4 columns are text and Excel they are concatenated to one column. My fifth column is a number and that's in the 2nd column in Excel. My column headers are all concatenated to a single cell.
When I paste to NotePad it looks fine. And even when I paste to a text box inside of Excel it looks fine. But when I go to paste the data from NotePad and the text box I get the same thing.
Does anyone know a solution for this? And is this an Excel or SQL issue?
Somehow the Text to Columns in my Excel settings got switched to comma instead of tab. Go to Data > Text to Columns > choose delimited and then choose tab.

Match Destination Formatting Excel 2016

Using Windows, I have followed the directions to add Match Destination Formatting to Excel in the tool bar, but it goes gray when I attempted to copy and paste from one excel spreadsheet to another. Is there something I am missing?
The option to match destination formatting is only available when the data to be pasted comes from another application, like Word. If you copy and paste between two Excel workbooks, you can use Paste Special > Formulas to achieve the same effect, i.e. keep the destination formats instead of overwriting them.

Highlight Every other row that contains information in column A vba

I was hoping you guys could help me figure something out. I am trying to get excel to highlight every other row that contains any information in column A
so it would look like this:
I haven't been able to make any proper headway into this but I was hoping you guys might be able to give me some basic direction.
You can do this without VBA, just use conditional formatting.
Mark the Range, go to Conditional formatting, add a new rule with rule type "Use a formula to determine which cells to format" and enter
=AND($A1<>"",MOD(ROW(),2)=1)
(depending on the regional setting, you might have to exchange the "," with ";" - same syntax as a regular formula)
Then, click the "Format" button and select a fill color.
Convert a range into a table in Excel:
You can make your range of data into a table (including auto-formatting):
Select (highlight) the cells (including the heading if there is one).
Hit Ctrl+T.
Hit Enter.
There are several ways you can then customize your table, such as the options on the ribbon.
More Information:
Office.com : Create or delete an Excel table
Office.com : Overview of Excel tables
Several other tutorials and examples on Google Search.

Setting an specific format for an Excel Column with VBA

I am currently working with a macro that gathers data (code identifier) from a source with a print screen and pastes it to excel.
Problem is, every time a data point (identifier) is a value with an "E" included, excel interprets as a scientific notation and changes the original value.
Is there a way to make excel set the column in which I have those values to text before pasting, or for it to paste the whole content as text automatically?
Thanks for the help.

Sql data loading blank row errors

I have an Excel file that contains some data that needs loading into my sql script. I have gotten most of it done but I am coming up against a problem due to the spreadsheet. The spreadsheet has data in rows that is implicit from the one above it (see the picture below).
Does anyone have any idea of how I can do this? Links to other pages would be welcome,I just wouldn't know how to start searching for this.
Quick way to fill the blanks in Excel:
Select the table
Hit F5
Click Special
Tick "Blanks" and hit OK
All blank cells in the table are now selected. Without changing the selection,
type a = sign
hit the up arrow key on your keyboard.
Hold down Ctrl and hit Enter
Now all previously blank cells contain a formula that references the cell right above. Copy the table and paste it over itself with Paste Special > Values to replace the formulas with the values.
Far less key strokes than writing a macro, and faster in the processing, too.