Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-31-2023, 07:58 AM
woyler woyler is offline remove line break on conditional formatting Windows 10 remove line break on conditional formatting Office 2019
Novice
remove line break on conditional formatting
 
Join Date: Jan 2023
Posts: 3
woyler is on a distinguished road
Default remove line break on conditional formatting

I have several conditional formatting statements stacked. I want to suppress the line break if the evaluation is blank.

{IF { MERGEFIELD Eval1} > 0 "{MERGEFIELD Value 1}" ""}
{IF { MERGEFIELD Eval2} > 0 "{MERGEFIELD Value 2}" ""}
{IF { MERGEFIELD Eval3} > 0 "{MERGEFIELD Value 3}" ""}

current output


Not Zero 1

Not Zero 3

desired output
Not Zero 1
Not Zero 3
Reply With Quote
  #2  
Old 02-03-2023, 03:31 AM
gmayor's Avatar
gmayor gmayor is offline remove line break on conditional formatting Windows 10 remove line break on conditional formatting Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,018
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Put all the fields on the same line and Include the line break within the quotes e.g.


{IF { MERGEFIELD Eval1} > 0 "{MERGEFIELD Value 1}" ""}{IF { MERGEFIELD Eval2} > 0 "
{MERGEFIELD Value 2}" ""}{IF { MERGEFIELD Eval3} > 0 "
{MERGEFIELD Value 3}" ""}
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 02-03-2023, 07:11 AM
woyler woyler is offline remove line break on conditional formatting Windows 10 remove line break on conditional formatting Office 2019
Novice
remove line break on conditional formatting
 
Join Date: Jan 2023
Posts: 3
woyler is on a distinguished road
Default

Thank you for the response! I have tried several variations of this method based on the pinned tips and tricks. It is still problematic in the event the all the evaluations have >0 values or not. I have tried the method you purpose and have also tried to nest the IF statements, but I am ending up with values on the same line or still some with line breaks.

My data is
CAT1 CAT1Value CAT2 CAT2Value CAT3 CAT3Value CAT4 CAT4Value
desc1 $10.00 desc2 $0.00 desc3 $15.00 desc4 $20.00
desc1 $10.00 desc2 $10.00 desc3 $0.00 desc4 $0.00
desc1 $0.00 desc2 $20.00 desc3 $0.00 desc4 $0.00
desc1 $20.00 desc2 $3.00 desc3 $10.00 desc4 $10.00
desc1 $10.00 desc2 $0.00 desc3 $0.00 desc4 $10.00

I am trying to get the first row evaluation to write:
desc1
desc3
desc4

unless I am misunderstanding your recommendation, the results are
desc1
desc3desc4
Reply With Quote
  #4  
Old 02-04-2023, 12:32 AM
gmayor's Avatar
gmayor gmayor is offline remove line break on conditional formatting Windows 10 remove line break on conditional formatting Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,018
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The line breaks go where I have shown in the following


{IF { MERGEFIELD CAT1Value } > 0 "{ MERGEFIELD CAT1 } { MERGEFIELD CAT1Value }" }{ IF { MERGEFIELD CAT1Value } > 0 "
" }{IF { MERGEFIELD CAT2Value } > 0 "{ MERGEFIELD CAT2 } { MERGEFIELD CAT2Value }" }{ IF { MERGEFIELD CAT2Value } > 0 "
" }{IF { MERGEFIELD CAT3Value } > 0 "{ MERGEFIELD CAT3 } { MERGEFIELD CAT3Value }" }{ IF { MERGEFIELD CAT3Value } > 0 "
" }{IF { MERGEFIELD CAT4Value } > 0 "{ MERGEFIELD CAT4 } { MERGEFIELD CAT4Value }" }
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 02-07-2023, 08:06 AM
woyler woyler is offline remove line break on conditional formatting Windows 10 remove line break on conditional formatting Office 2019
Novice
remove line break on conditional formatting
 
Join Date: Jan 2023
Posts: 3
woyler is on a distinguished road
Default

Perfect! I was missing the sequence of the conditional statements. Thank you for taking the time on the explanation!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Section and Line Break leaving line on previous page Stonehands99 Word 5 08-13-2019 08:59 PM
remove line break on conditional formatting Remove 2 Break Line in document Aminbhr Word 2 10-22-2017 06:36 AM
Interchange line break and paragraph break shortcut keys skan Word 2 01-20-2017 03:50 AM
Field Code Help - Remove Line Break zonixa Word 0 09-08-2016 10:59 AM
remove line break on conditional formatting How can I remove line break from 4 dash's nmss18 Word 2 09-11-2014 06:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:18 PM.


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