+ Reply to Thread
Results 1 to 6 of 6

Export from PDF then Text to Column

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Export from PDF then Text to Column

    Hello All,
    I have to export a PDF to notepad or excel then do TEXT to COLUMN at each double SPACES in text string was found. Please see sample attached and thank you very much in advance.

    Regards,
    tt3
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Export from PDF then Text to Column

    1. Use this formula in B1 to replace the double spaces with a semi-colon: =SUBSTITUTE(A1," ",";") - copy down.
    2. Copy and paste the VALUES of the results over the formula results in column B.
    3. Use Text to Columns on these values and define a semi-colon as the delimiter.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Export from PDF then Text to Column

    Hi AliGW,
    Thank you for your formula but it did not work as I expect because how to move the cell "A4" to the last column of above row. Please look at my sample to see a result tab.

    Regards,
    tt3
    Last edited by tuongtu3; 12-20-2015 at 03:53 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Export from PDF then Text to Column

    Quote Originally Posted by tuongtu3 View Post
    how to move the cell "A4" to the last column of above row.
    Sorry - I didn't see that final requirement. And sorry, I can't help you with that bit. However, what I have done should get you started.

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810
    Any other suggestions please.

    Regards,
    tt3

  6. #6
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Export from PDF then Text to Column

    Hello All,
    I came up with the below Macro Recording but something not right. Please take a look a and help:
    Sub tt3()
    Range("B1:B25").Formula = "=SUBSTITUTE(A1,"" "","";"")"

    Columns("B:B").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    '''Text2Column
    Columns("B:B").Select
    Selection.TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _
    TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
    Semicolon:=True, Comma:=False, Space:=False, Other:=False, OtherChar _
    :=" ", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
    1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1)), _
    TrailingMinusNumbers:=True
    Columns("B:J").Select
    Columns("B:J").EntireColumn.AutoFit
    With Selection
    .HorizontalAlignment = xlLeft
    .VerticalAlignment = xlBottom
    .VerticalAlignment = xlCenter
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With

    Dim Lr As Long, Lc As Long
    Lr = Range("B" & Rows.Count).End(xlUp).Row
    Lc = Cells(2, Columns.Count).End(xlToLeft).Column
    For i = Lr To 3 Step -1
    If Len(Cells(i, 2)) > 1 Then

    Cells(i, 2).Resize(1, 4).Copy Destination:=Cells(i, 2).Offset(-1, Lc) <=== i got a problem here how to paste to last column of above Row??
    Cells(i, 2).Resize(1, 18).Select
    Selection.Delete Shift:=xlUp
    End If
    Next i

    '''ArrangeColumn
    Columns("A:A").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:E").Select
    Selection.Cut
    Columns("B:B").Select
    Selection.Insert Shift:=xlToRight
    Columns("E:E").Select
    Selection.Cut
    Columns("D:D").Select
    Selection.Insert Shift:=xlToRight
    Columns("G:G").Select
    Selection.Cut
    Columns("J:J").Select
    Selection.Insert Shift:=xlToRight

    Range("A1").Select

    End Sub
    Regards,
    tt3

+ 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. Filter column by text, then export column to new workbook, replace searched text with new.
    By Headhunter234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2015, 07:48 AM
  2. [SOLVED] Format align text in column when export to excel with VBA
    By Cuong Pham in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 12:11 AM
  3. Export Each Column on Worksheet as Text File
    By ruezo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-26-2012, 11:33 AM
  4. Replies: 0
    Last Post: 07-12-2012, 12:31 PM
  5. Export Column to Text
    By madarekrap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-03-2011, 01:16 PM
  6. Export multiple columns to single column text files including special characters
    By mike4uuu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2011, 04:54 AM
  7. Export a Column from Text to Excel
    By walan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2005, 08:58 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