Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Houston, Texas, USA
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am converting a Word 2003 table to Excel. The Word table has multiple entries in a cell, each entry is followed by a soft return. When I paste the document into Excel, each entry in the cell becomes a separate cell in Excel.

    1. Can I make each of these entries in the one cell be in one cell in Excel?
    OR
    2. If I change the soft return to XXX (for example) in Word, how do I do a global search and replace in Excel to change the XXX to a soft return so that the entries stay in one cell.

    Thanks for your time!

    dfriloux

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='dfriloux' post='773866' date='05-May-2009 22:23']I am converting a Word 2003 table to Excel. The Word table has multiple entries in a cell, each entry is followed by a soft return. When I paste the document into Excel, each entry in the cell becomes a separate cell in Excel.

    1. Can I make each of these entries in the one cell be in one cell in Excel?
    OR
    2. If I change the soft return to XXX (for example) in Word, how do I do a global search and replace in Excel to change the XXX to a soft return so that the entries stay in one cell.

    Thanks for your time!

    dfriloux[/quote]
    Try the following code on the selection of cells containing "xxx".
    Note that I have used lowercase for the "xxx".
    Code:
    Public Sub Replace_xxx()
    	 Dim ocell As Range
    	 Dim xxx As Long
    		 For Each ocell In Selection
    			 xxx = InStr(1, ocell, "xxx")
    			 Do While xxx > 0
    				 ocell = Left(ocell, xxx - 1) & Chr(10) & Right(ocell, Len(ocell) - xxx - 2)
    				 xxx = InStr(1, ocell, "xxx")
    			 Loop
    		 Next
    	 End Sub
    Regards
    Don

Posting Permissions

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