R
Rod
I want to be able to set the properties of a cell font using a function.
I have tried the below but it errors in the function with
Error Number: 91
Error Description: Object variable or With block variable not set
Anyone not on holiday out there who can help me please!
happy new year
Rod
------------------------
'Calling code
xlSht.Cells(1, 1).Font = NameFormatType1(255)
Private Function NameFormatType1(NmCol As Long) As Excel.Font
NameFormatType1.Color = RGB(NmCol, 0, 0)
NameFormatType1.Bold = True
End Function
I have tried the below but it errors in the function with
Error Number: 91
Error Description: Object variable or With block variable not set
Anyone not on holiday out there who can help me please!
happy new year
Rod
------------------------
'Calling code
xlSht.Cells(1, 1).Font = NameFormatType1(255)
Private Function NameFormatType1(NmCol As Long) As Excel.Font
NameFormatType1.Color = RGB(NmCol, 0, 0)
NameFormatType1.Bold = True
End Function