Paste from SQL to Excel... Excel wants to think for me - excel

Group I am pasting data from SQL to Excel and it appears that Excel is trying to read my mind by converting some of my numbers to dates. I.e. one number is 2-2131 and when I paste it to excel it shows Feb-31 even 2-3291 wnats to be Feb-61
STOP IT EXCEL!
This is driving me crazy and I can't seem to find an easy way around this. I tried "paste special" as text and it still formats. I can get it to work if I create a connection and use the query, but I just want to be able to copy-paste data for testing purposes.
Anyone have an easy solution to my headache?
Thanks in advance!

Format the column as text before pasting the text.

Select the cells ahead of time and mark the formatting as Text. (Format->Cells, select "Text" from Categories and click OK). Then paste your data.

Hit F-2 before you paste the code and then it just puts it into one cell.

Highlight the affected row, right click, choose Format Cells..., select Text before you paste the data.

After pasting the sql data to excel, change the date and time format of excel to simple numbers seprated by dashes. That way round even if excel would assume it to be date, it would display the numbers as it is.

Related

Txt document data doesn't format correctly in Excel

Disclaimer - this should be a very simple task, but clearly everything I thought I knew about excel is false.
I'm trying to copy and paste data from a txt document to an excel document. An example of a line I'm trying to copy from the txt doc is: 4512544425701264.
However, when I paste into excel it pastes as 4512544425701260 but displays in the cell as 4.51254E+15. This happens for each line of data.
I've tried numerous ways to fix this problem none have worked including:
Copied the txt data into a Microsoft Word document, then tried
pasting into the excel.
Resized the cell.
Tried each cell formatting option.
Tried opening the txt doc in Excel, even progressed through the text import wizard. Interestingly, I noticed the data preview on page 3 displayed the data correctly. But after proceeding past the importer, the data loaded with the same problem.
Tried on another PC.
Copied and pasting one line at a time.
The only solution I have found is manually typing out each line, however this is highly unpractical due to the large amount of data.
Any help/advice would be greatly appreciated.
To show full number rightclick on cell, choose "Format cells..". In "Number" tab choose "Number" category and set "Decimal places" to zero.
Unfortunately excel lets to put only 15 digits as a number. Every additional number is converted to 0, that is why your number 4512544425701264 is converted to 4512544425701260
If you don't need this number to be used in calculation, you can format cells to text format before pasting:
Source on digits limitation: https://learn.microsoft.com/en-US/office/troubleshoot/excel/last-digits-changed-to-zeros
In Excel, this is expected behavior (it's Microsoft, after all). I have encountered it frequently when dealing with UPC codes, for example. In order to avoid this, format the cells you are trying to copy this data to as "Text" BEFORE you copy any data over.
Copy your data (CTRL+C), then select the first cell in the range where the data is going, then paste only the values. This should take care of it.
If for some reason you still get scientific notation, provided the cells have the "Text" formatting, you can select that cell, click in the Formula bar and hit ENTER.
When you paste into Excel, try calling "Text import wizard" in the Paste Options. This will allow you to set delimiter (in case of CSV) and later data type of a column where you can select "Text" which will tell wizard not try to convert your data into numbers.

How do I fix cells in Excel that contain formulas, but are showing as empty cells?

I have tried to find this scenario somewhere but haven't been able to find any useful resources.
Essentially, I have performed some work in Excel and upon returning to the file the row sizes were so large the file could not used properly, and the cells were blank. The row sizes was an easy fix, however the blank cells are strange because they still contain text/formulae.
Has anyone seen this issue before, and know how to fix it?
Thanks!!!!
In this image, you can see that the selected sell contains some text
Here, if I double click to edit the cell contents, there seems to be some kind of disconnect between the location of the cell, and where Excel is allowing me to edit the text
I think you should start working with "formulatext()" Excel function: if you have a formula, this returns a full string
I've seen issues like this in the past and have always first tried the "Text to Columns" Data Tool on the Data Menu. I have used this when cells are unexpectedly blank, or when my dates are registering as dates or formulas are registering as formulas. It might help.

Copy and Paste Excel selection into Word - data disappears

I've been trying to copy & paste a table from Excel into Word, by inserting it as an Excel worksheet object and ensuring I paste as a link, so I retain the formatting from Excel, and allows me to access the specific table easily.
Unfortunately, the excel table disappears apart from the final row of the selection when I paste into Word, and I've no idea how to fix it. The internet isn't giving me any solutions either.
Is this a known issue? Or is there a way around this?
Thanks in advance
#Rob, i cannot comment (no privilege) so need to do this via an answer: please check the paragraph setting of the paragraph where you copied the table to and try changing it to anything but not 'fixed height'. Fixed really makes it look as if 1 row is pasted. Let me know if it worked, it did for me.

Pasting Excel tables in Thunderbird e-mail client

When I paste an Excel table in Thunderbird e-mail client (ver 24.2.0) the table looses its formatting. One workaround seems to be that you paste the table from Excel to Word and then paste it in Thunderbird. But this seems a bit odd as Word and Excel are part of the same Office Suite of applications, yet their behavior is strange.
Can anybody shed any light on it?
Copy from Excel,
Paste into word -> Paste Options -> Keep Source formatting,
then highlight the table, Go to Design -> on the right, Increase the "Line Weight" to a minimum of 1 point, then click on "Borders" and select "All Borders"
Now copy this table and paste it in your Email. It should work.
The fastest way to copy excel tables as they are, in Thunderbird is to first copy the table to Word, and then recopy and paste within html email.
Colors, lines, format are kept as they are...
Another workaround you can do entirely within Excel is copy the cells for your table, pasted as a picture in Excel and then copy/cut the picture from Excel and then paste to Thunderbird. You lose the ability to edit in place in Thunderbird, and increase the size of the email but you keep all the formatting from Excel.
So far,the best solution is paste the table into Word and then copy from there.
This is a bug from 2003 Reference Link,but didn‘t fix it.
Paste the table as it is in mail from excel, then go to
Format --> Table --> Table Properties
In Borders & Spacing, keep the Borders as- 1 or 2 pixels.
It is working 100%
This is a bug in thunderbird. I overcome this by using LibreOffice (or open office) spreadsheet. Formatting is not lost when we copy from Libreoffice Calc. Thunderbird development is a bit lousy :-). Keeping this bug open for long time.
try to use "Text To column" function under the "DATA" TAB
it will make the column suitable to be pasted as a text

Pasting the same text copied from different sources behaves differently in Excel

Now this is a weird one
We have a project where we are reading some data from an Excel spreadsheet. Obviously this data has to be in a certain format. Some of the fields consists of numbers, but should be treated as text.
To stop Excel from being "smart" and change the cell types, I have set the format in the respective cells to 'text'.
Now here is the problem: some of the numbers we're pasting have spacing between the digits. When we remove the white spaces, Excel change the cell format to 'standard' and turn the text into the 2.42805E+11 format.
BUT: this only happens when the text is copied from some sources. If a paste a number copied from a textbox, everything turn out fine when we edit the spaces. If we copy the exact same number from a web page, Excel change cell format.
I thought copy-paste would be copy-paste, but obviously some formating or something gets along on the ride.
Does anyone know what causes this, or know have to get Excel to stop being "smart" with the formating?
EDIT: I found a somewhat peculiar solution to this. I recorded a macro that uses the 'Paste Special' function with text as parameter, and overrided ctrl-v with it (in that particular spreadsheet). Works like a charm! Feels a bit "hacky", though. Can anyone think of a scenario where this will backfire?
Try using the Edit Paste Special command, it will give you some controls to choose what to do with the data.
For a taste of the complexity of what is really going on underneath, look in MSDN about Clipboard Formats. In short, it isn't all Excel's fault...
A common user trick copying data out of excel is to paste it into Notepad and cut it back to the clipboard, which flattens all the formatting down to plain text. It won't help you for pasting data into Excel, however.
Copy-paste in windows retains formatting. One way to get rid of the formatting is to paste the text into e.g. notepad first, then select and copy it again. This loses any copied formatting.

Resources