Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2014, 04:05 PM
mrayncrental mrayncrental is offline How can I delete spaces & lines in a table cell Windows 7 64bit How can I delete spaces & lines in a table cell Office 2007
Novice
How can I delete spaces & lines in a table cell
 
Join Date: Feb 2014
Posts: 15
mrayncrental is on a distinguished road
Default How can I delete spaces & lines in a table cell

Within a table, I have a column that has multiple paragraphs in each cell. Some cells may have 1 paragraph - others may have up to 5.

I want to delete all of the blank spaces & lines at the end of the last paragraph in the cell so the table cell is as small as possible.

The number of blank spaces and lines are inconsistent --- some cells many have none - some may have 1 blank line - some may have many.

Thanks for your help!
Reply With Quote
  #2  
Old 10-20-2014, 05:02 PM
macropod's Avatar
macropod macropod is offline How can I delete spaces & lines in a table cell Windows 7 64bit How can I delete spaces & lines in a table cell Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a sequence of wildcard Find/Replaces, where:
Find = [ ]{2,}
Replace = ^32
Find = [ ^13]{1,}
Replace = ^p
Find = [^13]{1,}
Replace = ^p
This will reduce all repeated space & paragraph sequences to one of each, then reduce and combined paragraph/space sequences to just a paragraph break. At worst, you'll be left with cells that have a unnecessary paragraph break in the last paragraph before the end-of-cell marker. No need for VBA, though you could record the above as a macro.

What's not clear, anyway, is what you'd want to do vis-à-vis paragraph beaks and end-of-cell markers.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-20-2014, 06:48 PM
mrayncrental mrayncrental is offline How can I delete spaces & lines in a table cell Windows 7 64bit How can I delete spaces & lines in a table cell Office 2007
Novice
How can I delete spaces & lines in a table cell
 
Join Date: Feb 2014
Posts: 15
mrayncrental is on a distinguished road
Default

The challenge is - I don't want to delete the blank lines between the "real" paragraphs. For example:

Paragraph 1.................................

Paragraph 2................................

Paragraph 3........................... (I want to delete everything after paragraph 3)


The table is actually built by PowerPoint through the "Publish to Word" function. I have a macro that swaps out the slide pictures and reformats the tabel, etc.

The problem is with the notes from PPT. Many times there are several blank lines in the table cell and it causes the entire cell to be too large. So I want to eliminate the blank lines.

I know this is a difficult one to try and fix because search and replace won't work and because I don't want to delete the blank lines that should exist.

Thoughts????
Reply With Quote
  #4  
Old 10-20-2014, 07:09 PM
macropod's Avatar
macropod macropod is offline How can I delete spaces & lines in a table cell Windows 7 64bit How can I delete spaces & lines in a table cell Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Did you actually try the Find/Replace? You also mention using a macro for transferring the notes from PowerPoint. In that case, you really should be cleaning the data as part of the transfer process (e.g. via Trim).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I delete spaces & lines in a table cell Delete table if cell has data So New2 This Word VBA 1 05-06-2013 09:00 PM
How can I delete spaces & lines in a table cell Extra spaces between the lines after pasting data to Word ramsgarla Word VBA 1 10-29-2012 12:26 AM
How can I delete spaces & lines in a table cell Columns lines in table have spaces and indents in the borders lukester Word Tables 3 07-11-2012 07:01 AM
How can I delete spaces & lines in a table cell Word VBA: Cannot Edit Range (Delete characters except the first in a table cell) tinfanide Word VBA 3 04-27-2012 09:48 AM
Text Wrapping on Fixed Lines in a Form field/Table cell okrmjr Word Tables 0 10-30-2009 08:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft