+ Reply to Thread
Results 1 to 8 of 8

Insering newline at every space

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Chennai, India
    MS-Off Ver
    Excel 2003, 2010
    Posts
    212

    Re: Insering newline at every space

    post a sample file...

  2. #2
    Registered User
    Join Date
    10-23-2012
    Location
    LON
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Insering newline at every space

    Quote Originally Posted by Rem0ram View Post
    post a sample file...
    sample file is attached

    Data.txt

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insering newline at every space

    Does this help?

    Sub mandukes()
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Copy
    Cells(3, 1).PasteSpecial Transpose:=True
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Delete
    End Sub
    assumes original data is on row 2.

  4. #4
    Registered User
    Join Date
    10-23-2012
    Location
    LON
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Insering newline at every space

    Quote Originally Posted by JOHN H. DAVIS View Post
    Does this help?

    Sub mandukes()
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Copy
    Cells(3, 1).PasteSpecial Transpose:=True
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Delete
    End Sub
    assumes original data is on row 2.

    Not working
    Last edited by mandukes; 12-05-2013 at 08:15 AM.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insering newline at every space

    Maybe:

    Sub mandukes()
        Range("A2").Select
        Selection.TextToColumns Destination:=Range("A2"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
            Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
            :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1)), _
            TrailingMinusNumbers:=True
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Copy
    Cells(3, 1).PasteSpecial Transpose:=True
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Delete
    End Sub
    Assumes original data is on row 2 of a spreadsheet.

  6. #6
    Registered User
    Join Date
    10-23-2012
    Location
    LON
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Insering newline at every space

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Sub mandukes()
        Range("A2").Select
        Selection.TextToColumns Destination:=Range("A2"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
            Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
            :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1)), _
            TrailingMinusNumbers:=True
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Copy
    Cells(3, 1).PasteSpecial Transpose:=True
    Range(Cells(2, 1), Cells(2, ActiveSheet.UsedRange.Columns.count)).Delete
    End Sub
    Assumes original data is on row 2 of a spreadsheet.
    Thank you It works

    but it needs to be done in the "text file". When the program runs it would open the text file and do necessary changes and save the file.
    Maybe I'm asking too much :P
    but thanks for the code

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to replace space with newline
    By utpalmtbi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-11-2013, 09:13 PM
  2. [SOLVED] Problem in insering header picture in word through excel
    By spmltr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2012, 05:48 AM
  3. Insering empty rows after each
    By HarryKlein in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-31-2011, 06:20 AM
  4. insering empty row based on a condition
    By darkhorse4321 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2010, 02:16 AM
  5. Insering an image on a specific cell
    By Moiz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2005, 07:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1