Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Properties returning object reference or value?
In the Help for Font Object, there is this example code:
Worksheets("Sheet1").Range("A1:C5").Font.Bold = True The help also says that the Font property returns a Font object. Assuming that the property returns a value rather than a reference, I'm imagining an actual construct that exists apart from the range itself, containing fields that describe the font(s) used within the range. I'm trying to understand how assigning a True to one of the member fields in the Font object (the Bold field) causes True to be propagated back to the actual range cells. In C++ vernacular, has the assignment operator "=" been overriden? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Properties returning object reference or value?
Bold is a property of the Font object. The Boolean value of Bold is either
True or False. It has nothing to do with the Range Object. wrote in message ... In the Help for Font Object, there is this example code: Worksheets("Sheet1").Range("A1:C5").Font.Bold = True The help also says that the Font property returns a Font object. Assuming that the property returns a value rather than a reference, I'm imagining an actual construct that exists apart from the range itself, containing fields that describe the font(s) used within the range. I'm trying to understand how assigning a True to one of the member fields in the Font object (the Bold field) causes True to be propagated back to the actual range cells. In C++ vernacular, has the assignment operator "=" been overriden? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Properties returning object reference or value?
Function emboldened(target As Range) As Boolean
Application.Volatile On Error Resume Next emboldened = target.Font.Bold '= True If Err.Number < 0 Then emboldened = False End If On Error GoTo 0 End Function this UDF actually returns TRUE if all the cells in the selected Range have their FONT Emboldened set to TRUE The error trap is required since a #Value is returned if some but not all cells in the passed range have this. wrote in message ... In the Help for Font Object, there is this example code: Worksheets("Sheet1").Range("A1:C5").Font.Bold = True The help also says that the Font property returns a Font object. Assuming that the property returns a value rather than a reference, I'm imagining an actual construct that exists apart from the range itself, containing fields that describe the font(s) used within the range. I'm trying to understand how assigning a True to one of the member fields in the Font object (the Bold field) causes True to be propagated back to the actual range cells. In C++ vernacular, has the assignment operator "=" been overriden? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Returning Access Table properties to Excel | Excel Programming | |||
Returning Access Table properties to Excel | New Users to Excel | |||
returning pivottable object from a range object | Excel Programming | |||
Workbooks.Open(filename) : Returning err: Object reference not... (in VB.NET) | Excel Programming | |||
iterating through all properties of an object | Excel Programming |