jaybee
jaybee

Reputation: 51

Copy TAB (\t) character in an excel cell

Basically I have a data like this

1 2 3 4

that is separated by a TAB(\t) character.

My problem is whenever i copy this type of data in an excel cell, the data is converted to

1234

and not

1 2 3 4.

Is there a way to do this? Thanks a lot in advance!

Upvotes: 2

Views: 15619

Answers (2)

Mark
Mark

Reputation: 1

Or with Replace:

  • Copy a tab character from your data
  • and paste it into the Find box,
  • then put spaces or whatever you want to replace it with in the Replace with box.

Using this method is easy and choosing an option in the Within list allows you to replace all the tabs in anything from a selection of cells, all of a sheet to the entire workbook. It can work for at least some other special characters too.

Replace panel may be got with control-H, or Find and Select in ribbon, or Edit menu > Find > Replace ...

Upvotes: -1

Scott Craner
Scott Craner

Reputation: 152585

Tabs are not displayed in Excel. The tabs when copied in are still there just not displayed. One will need to replace them with spaces. This can be done in another cell with a formula:

=SUBSTITUTE(A1,CHAR(9),REPT(" ",4))

Or in mass in place with VBA:

Sub MyTabReplace()
    ActiveSheet.Range(A:A).Replace Chr(9), "    "
End Sub

Upvotes: 4

Related Questions