![]() |
|
#1
|
||||
|
||||
|
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
Thanking you in advance ![]() Cendrinne |
| 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 |
If condition not working.
|
jhansrod | Word VBA | 8 | 06-15-2019 05:59 AM |
How to use if condition to for this ...
|
LearnerExcel | Excel | 1 | 12-19-2016 02:14 PM |
Use Two (concatenate) Fields If Condition Is Met (If... Then... Else)
|
SoonerLater | Mail Merge | 1 | 09-30-2015 05:40 PM |
check with condition
|
karti | Word | 2 | 03-15-2011 06:06 AM |