I would like to write a function that outputs an array (or range of zeros and ones) that tells me whether the target range cells (in a column) are bold or not. I then want to take this array and perform a sumproduct with another array of zeros and ones.
For example:
Function BoldArray(target As Range)
Dim r As Integer
Application.Volatile
For r = 1 To target.Rows.Count
BoldArray(r, 1) = target.Cells(r, 1).Font.Bold
Next r
End Function
Ultimately, I'd like to have a cell with the following formula: SUMPRODUCT(A1:A5,B1:B5,BoldArray(B1:B5)). The reason I'm not doing all of this in one function is because I need the target ranges to float automatically as the spreadsheet expands/contracts. For example, A1:A5 may be A10:A54 at some point in the future.
Thanks!
Bookmarks