Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to copy cells from Excel, and paste it to notepad with comma as delimiter, in stead of tab(which it is). Is there any way to do this without doing a replace in Notepad or saving the spreadsheet as .csv?


share|improve this question
Refer to my answer in another question:… – wilson Nov 16 '12 at 9:55
@wilson Stefan is asking about doing it without using Notepad, and to use something other than tab as the delimiter – Rowland Shaw Nov 16 '12 at 10:01
@RowlandShaw: Stefan said "without doing a replace in Notepad", not "without Notepad". – Karan Nov 17 '12 at 23:38
up vote 3 down vote accepted

I don't think there's any way of changing the default delimiter character (i.e. Tab) used while copying text to the clipboard from Excel. What you can do however is create a macro to achieve the result you want.

  1. Create a macro named something like CopySelectedCells and optionally assign a keyboard shortcut so you can invoke it quickly (I assigned it Ctrl+Shift+C for example):


  2. From the main Macro dialog shown above, click the Edit button to open the VBA Editor.

  3. Go to Tools menu / References and click on the Browse button.

  4. Add Windows\System32\FM20.dll:


  5. Select the Microsoft Forms 2.0 Object Library option now added to the Available References list:


  6. Edit the macro code to look like the following:

    Sub CopySelectedCells()
        Dim str As String
        For Each rangeRow In Selection.Rows
            For Each rangeCol In rangeRow.Cells
                str = str & rangeCol.Value & ","
            str = Left(str, Len(str) - 1) & vbCrLf
        With New DataObject
            .SetText str
        End With
    End Sub
  7. Close the VBA Editor, select a range of cells and invoke the macro, then paste in Notepad to see the comma-separated result.

share|improve this answer
Thanks, this will have to do. – Stefan Pietersen Nov 21 '12 at 7:28

Contatenate required cells as string in a not used cell with comma between them and copy only this new cell and paste in notepad. For example: =A1&","&B1

share|improve this answer
If there are hundreds of columns then concatenate may not be a good option as you have to select cells by hand and cannot drag-select the cells to be concatenated. – Prasanna Apr 30 at 2:25

You could replace all tabs with commas in Notepad++. Select all text, press Ctrl+H and use \t for tab. Be sure to turn "Extended" search mode on.

Replace tabs with commas

share|improve this answer
How is this any better compared to replacing Tabs in Notepad? – Karan Nov 17 '12 at 23:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .