Link to home
Create AccountLog in
Avatar of Saqib Husain
Saqib HusainFlag for Pakistan

asked on

Word VBA: Finding text with a particular color.

Can someone give me code to get the font color at the current cursor position and then look for the next text with the same color?
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Here is an example to get font color

Worksheets("Code Sheet").Cells(i, 1).Font.Color

Open in new window

Here is one other example to find out one specific string

    Set c1 = Worksheets("Code Sheet3").Cells.Find(Para_Country)

    If Not c1 Is Nothing Then
        Worksheets("Budget-Report-HO").Cells(3, 5).Value = Worksheets("Code Sheet3").Cells(c1.Row, 2).Value
    Else
        Exit Sub
    End If

Open in new window

Avatar of Rgonzo1971
Rgonzo1971

@HuaMinChen Word VBA not Excel VBA
Avatar of Saqib Husain

ASKER

Just perfect, thanks.
Word or Excel I'm confused...
Sorry, wrong answer accepted. I cannot find the request attention button.
Maybe the flag "report"
Yes, I already did that.