Replace a space with a tab

Valérie -  
 Turtle -
Hello,
I am searching everywhere in vain for how to replace a space or a comma with a tab in Excel. I was told to do "Edit --> Replace , with ^tab" but it doesn't work.
Thank you for your help!!
Configuration: Windows XP Internet Explorer 6.0

1 answer

  1. Turtle
     
    I work on Excel and here is a piece of code that I hope will help you

    Sheets("Sheet1").Columns(1).Replace " ", ","
    This code allows you to replace all spaces in sheet 1 of column A with a comma.

    Otherwise, my goal is to process data from a txt file that I need to insert into my Excel table.
    So I insert the data line by line.

    Open fich For Input As #1
    l = 0
    Do Until EOF(1)
    Line Input #1, data
    data = Replace$(data, vbTab, "!")
    ActiveCell.offset(l, 0) = data
    l = l + 1
    Loop
    Close #1

    This opens my file, inserts line by line, and before that replaces all tabs with an exclamation mark.

    Good luck
    see you later
    0
    1. Turtle
       
      The correct command is ^t. So in the Edit/Replace menu, you enter:
      - a space in the Find field
      - ^t in the Replace with field, and all your spaces will be replaced by a tab, which will allow you to retrieve all your data in Excel.
      0