- #How to have text file paste into excel columns update#
- #How to have text file paste into excel columns code#
#How to have text file paste into excel columns update#
This post is a neatened update of a post originally published on my main blog (I’m gradually transferring the techy posts I’ve published there… here). Microsoft’s help page on the CONCATENATE function Sometimes it’s handy to be able to order a spreadsheet of people’s names by their surname as well as by their first name, so it’s quite handy to have one column for their forename and another for their surname. Why not just collect people’s names as names rather than FirstName LastName?
#How to have text file paste into excel columns code#
The code works satisfactorily to the extent copying and pasting data in the destination excel sheet, but additionally, opens up another excel file and sheet with the same name as the Text file, without being prompted anywhere in the code, and pastes the data. Then paste from the notepad file back into an empty column and you can delete the other three safely. I was trying to copy a text file and paste the data in excel using the following code. If you want a text-only version I think the quickest way to do this is to select Column C and copy (Ctrl+C) its contents, then paste temporarily into a text file (eg notepad.exe) which will paste the words you see in the column and not the underlying maths. This lesson is in response to a viewer who asked me, 'How do I change data that runs across a row into data that runs down a columns I get my original data. This format will also work =A1 & A2 (or if you need a space it’s =A1 & ” ” & A2)īeware: do not now delete columns A and B or your newly created column C will disappear as each cell is actually a formula, contingent on the contents of other cells.
If you have lots of names in columns A and B you can double click on the tiny green square at the bottom right and the formula will cascade all the way down your list, stopping at the last item.
Note that Cell C1 is highlighted (surrounded by a green border). Instead, it used each space in the table’s text as a delimiter and pasted the table into separate columns, just as I had specified using the initial Text to Columns command.
That is, Excel didn’t paste the table into column A this time. If this doesn't work, and everything you paste appears in. When I pasted the next table, Excel automatically applied my current text-to-columns setting to the new data. On my version of Excel this format will include a space between the two but you can force one if yours doesn’t, with =CONCATENATE(A1, ” “, B1). Excel can typically automatically detect text that is separated by tabs (tab-delimited) and properly paste the data into separate columns. The formula is of the format =CONCATENATE(A1,A2) which will combine the separate names in Cell A1 and Cell B1 into one.