Consulting

Results 1 to 3 of 3

Thread: Joining text in selected cells

  1. #1
    VBAX Regular
    Joined
    Jul 2007
    Posts
    78
    Location

    Joining text in selected cells

    After copying and pasting from a pdf file, the copied text are split up into different rows. which I have to edit so that the text belonging to the same sentence are into one cell. I would be please if someone can show me how to create a macro that will allow me to join the text into a single cell.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    This simple maxcro takes the activecell and pulls the data from the cell below. It can be done to repeat on selected cells

    [vba]

    Public Sub Test()
    With ActiveCell
    .Value = .Value & " " & .Offset(1, 0).Value
    .Offset(1, 0).Delete shift:=xlUp
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    Aug 2006
    Location
    Hampshire, UK
    Posts
    140
    Location
    Quote Originally Posted by andytpl
    After copying and pasting from a pdf file, the copied text are split up into different rows. which I have to edit so that the text belonging to the same sentence are into one cell. I would be please if someone can show me how to create a macro that will allow me to join the text into a single cell.
    Also, depending on how much you are copying at one time, if you Edit (ie F2) the destination cell before pasting, then paste, it should all be pasted into the single cell.

    Richard

Posting Permissions

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