Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-25-2021, 08:30 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition Windows 10 Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition Office 2019
Competent Performer
Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition

Hello Pros,
I'm pretty proud of myself, to figured out how to have Row 1 if the Font color is DarkRed, for example, to put Row(1) as Text.

It works, I've tested it on tables with multiple rows, having DarkRed on Row 1 and other tables having it a blue for instance, on Row 1.
And some single Table Row being either DarkRed and others being Blue.

What I'm having an issue, is trying to find Font Color DarkRed AND Font being Bold.

As you can see with the single quote, ' , which is considered Text (in VBA, it would show in Green), I'm just trying to show i've tried many ways, it didn't work.

Code:
Sub TBL_to_Txt_if_Row1_is_DarkRed()

Application.ScreenUpdating = False
    
    Dim aTbl As Table, aRow As Row
    Dim rg As range

    For Each aTbl In ActiveDocument.Tables
      With aTbl
       '.Rows(1).range.Font.Color = wdColorOrange / wdColorDarkRed
       '.Rows(1).range.Font.Color = 192
       '.Rows(1).range.Rows.Select
         
        'Selection.SplitTable
     'End With
      
       'If (aTbl.Rows(1).range.Font.Color = 192) + (aTbl.Rows(1).range.Font.Bold = True) Then
       'If (aTbl.Rows(1).range.Font.Bold) + (aTbl.Rows(1).range.Font.ColorIndex = 192) = True Then
        If aTbl.Rows(1).range.Font.Color = 192 = True Then
        
    .Rows(1).ConvertToText Separator:=wdSeparateByParagraphs, _
        NestedTables:=False
        
        Else
        
        End If
      
      End With
    Next
    
Application.ScreenUpdating = True
  On Error GoTo 0
  
lbl_Exit:
  Exit Sub

End Sub
Any insights would be soooooo appreciated.



Thanking you in advance

Cendrinne
Reply With Quote
 

Tags
2x conditional format, help please, rows(1)



Similar Threads
Thread Thread Starter Forum Replies Last Post
sumProduct with OR condition ShostyFan Excel 7 10-16-2019 02:19 PM
Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition If condition not working. jhansrod Word VBA 8 06-15-2019 05:59 AM
Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition How to use if condition to for this ... LearnerExcel Excel 1 12-19-2016 02:14 PM
Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition Use Two (concatenate) Fields If Condition Is Met (If... Then... Else) SoonerLater Mail Merge 1 09-30-2015 05:40 PM
Help, IF with 2 Conditions, Then, Else, only works if I have 1 condition check with condition karti Word 2 03-15-2011 06:06 AM

Other Forums: Access Forums

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


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