, , . , , .
, , , , , .
Here is a function that can do this. In tests (Excel 2003), this is done 8x-10x faster than always, setting the format, and when screen refresh is turned off.
Sub SetProperty(ByRef obj As Object, propname, newvalue)
If CallByName(obj, propname, VbGet) <> newvalue Then
Call CallByName(obj, propname, VbLet, newvalue)
End If
End Sub
Name it as follows:
Call SetProperty(Cells(1,1).Font, "ColorIndex", 27)
Call SetProperty(Cells(1,1).Borders, "Weight", xlMedium)
etc
source
share