Hi Andrew,
One thing you could do is create a structure called a user defined type (UDT) to hold the relevant values you need. For example:
Type tFont
Fontstyle As Variant
Size As Variant
End Type
Sub foo()
Dim formatArrayRight(7 To 60) As tFont
Dim act As Long
For act = 7 To 60
With Range("M" & CStr(act)).Font
formatArrayRight(act).Fontstyle = .Fontstyle
formatArrayRight(act).Size = .Size
End With
Next act
End Sub
It's quite unusual to give an array a lower bound of 7 though. Usually programmers use 0 or 1.
By the way, the reason the code errored in your original post is because Font is an object, so you need to use the Set keyword:
'(your original code)
Dim formatArrayRight(7 To 60) As Font
Dim act As Integer
For act = 7 To 60
Set formatArrayRight(act) = Range("M" & act).Font
Next act
Bookmarks