Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2020, 04:14 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Windows 10 Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Office 2019
Competent Performer
Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Smile Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value

OK pros, I've search and search and come out empty. I'm looking to do ''conditional formating'' in a Word table.

First, I've did a Find and Replace for all Important periods ( ==>end of sentences only) to put them in the color Red in a freaking long tables that has only 2 columns, but is close to 2 thousands of rows.
Note ===> Just that script was challenging to find all the ways, the periods are not at the end of the sentences. But it's ok, I've done a long script. Not too familiar with cases
Now my challenge is to Find the cells, that has more than 1 periods that are identified as Red color.

I know I must do a count, and >1. I cannot find a script.
And by the way, the two periods are not in a row. So I'm looking to have each sentence in a cell. So I'm looking for those that are more than 1 sentence in a cell.



Any advice, where to look for such a script, if a script is doable.

I have presently Word 365.

I thank you in advance for any insights
Reply With Quote
  #2  
Old 10-22-2020, 04:22 PM
Guessed's Avatar
Guessed Guessed is offline Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Windows 10 Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Show us the code to identify your "important periods". It is probably easier to adapt that code than it is to run a second macro since the processing of every cell is where the big time hits are going to occur.

And post a sample document so we can see exactly what you are doing to tag the periods.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 10-22-2020, 04:32 PM
gmaxey gmaxey is offline Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Windows 10 Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oTbl As Table
Dim oCell As Cell
Dim oRng As Range
Dim lngCount As Long
  Set oTbl = ActiveDocument.Tables(1)
  For Each oCell In oTbl.Range.Cells
    lngCount = 0
    Set oRng = oCell.Range
    With oRng.Find
      .Text = "."
      .Font.ColorIndex = wdRed
      Do While .Execute
        If Not oRng.InRange(oCell.Range) Then Exit Do
        lngCount = lngCount + 1
        oRng.Collapse wdCollapseEnd
        If lngCount > 1 Then
          oCell.Range.HighlightColorIndex = wdBrightGreen
          Exit Do
        End If
      Loop
    End With
  Next oCell
lbl_Exit:
  Exit Sub
  
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #4  
Old 10-22-2020, 05:21 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Windows 10 Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Office 2019
Competent Performer
Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Greg Maxey, that script works Thanks. It took a long time but still worked

OMG, I'm in a awwwwe how pro's can think of such scripts like this. I'm still novice I guess.

Thank you so much, Greg, I'm deeply grateful.

Case solved
Reply With Quote
  #5  
Old 10-22-2020, 05:25 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Windows 10 Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Office 2019
Competent Performer
Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Hello Guessed (Andrew),
I was starting to translate my script, cause much of it was in French or Bilingual (Eng and French), but I saw Greg's script and tried it at once.

But thank you to offer to help. That long script, would have been embarrasing to me to pro's like yourself, how long it is. But it does work. One day, I'll get the hang of it. Keep searching, and bought many books to help me.

Thanks again

Have a great evening all of you
Reply With Quote
Reply

Tags
background color, find, flag

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting more than 4 cells into Word tables ignores cell divides 2vbr Word Tables 0 09-21-2020 08:16 PM
Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value How to make gridlines in cells of tables in MS Word 2007 pgrewal Drawing and Graphics 1 07-18-2014 11:12 PM
Shading in Cells in Word Tables Cindy Word Tables 1 01-04-2013 02:38 PM
Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Word 2007 Tables - Shift cells backwards one place bloodge1 Word Tables 3 08-28-2012 10:11 PM
Have a challenging inquiry in Word tables cells, to flag me if a cell contains more than 1 value Copy table cell formatting across multiple cells / tables pakistanray Word Tables 2 10-31-2011 08:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:45 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