Using Replace to Replace Formatting : Replace « Forms « VBA / Excel / Access / Word






Using Replace to Replace Formatting

 
Sub ReplaceFormats() 
    ' set formatting to look for 
    With Application.FindFormat 
        .Font.Bold = True 
        .Font.Size = 11 
    End With 

    ' set formatting that should be applied instead 
    With Application.ReplaceFormat 
        .Font.Bold = False 
        .Font.Italic = True 
        .Font.Size = 8 
    End With 

    ActiveSheet.Cells.Replace What:="", Replacement:="", _ 
        SearchFormat:=True, ReplaceFormat:=True 
End Sub 

 








Related examples in the same category

1.Replace information in all sheets of the workbook
2.Replacing with the Replace Method