NewOrderFac33
Well-known Member
- Joined
- Sep 26, 2011
- Messages
- 1,283
- Office Version
- 2016
- 2010
- Platform
- Windows
Good afternoon,
I have the following procedure which adds a formula to a range, then attempts to convert the resulkts of those formulae into values.
However, I would expect the" .value" to be capitalized i.e. ".Value", but it just seems to be ignored and doesn't snap into place like I'd expect it to.
Can anyone suggest what I'm doing wrong, please?
Thanks in advance
Pete
I have the following procedure which adds a formula to a range, then attempts to convert the resulkts of those formulae into values.
Code:
Sub AlignAndFormatTotalLeadTimes()
Set TotalLeadTime = Sheets("Database").Range("Col_DB_TotalLeadTime")
'Right align apply number format and remove "NULL" or zero values from Total LeadTime column
With Range("Col_DB_TotalLeadTime")
.NumberFormat = "[h]""h"" mm""m"" ss""s"""
.HorizontalAlignment = xlRight
.FormulaR1C1 = "=IF(OR(RC[-3]=0,RC[-1]=0),""-"",RC[-1]-RC[-3])"
.Formula = .value
End With
End Sub
However, I would expect the" .value" to be capitalized i.e. ".Value", but it just seems to be ignored and doesn't snap into place like I'd expect it to.
Can anyone suggest what I'm doing wrong, please?
Thanks in advance
Pete