snowdyce
10-23-2012, 12:55 PM
Hello Experts,
I am running into a snag in terms of an Empty value vs a Zero. I have this little if statement that loops for each month. It works correctly on all months except December. So it states if the selected cell IsEmpty, then make that variable (Dec_CC) empty/blank. This works on other Columns, but here it puts a Zero as the value for Dec_CC, even after it is approved on the initial If. I also tried to change the Then section to = "" and I get a runtime 13 error. Any thoughts?
If IsEmpty(ActiveSheet.Cells(21 + i, 16).Value) Then
Dec_CC = ActiveSheet.Cells(21+ i, 1g).Value 'also tried = "" here
Else: Dec_CC = Round(ActiveSheet.Cells(21 + i, 16).Value, 0)
End If
I am running into a snag in terms of an Empty value vs a Zero. I have this little if statement that loops for each month. It works correctly on all months except December. So it states if the selected cell IsEmpty, then make that variable (Dec_CC) empty/blank. This works on other Columns, but here it puts a Zero as the value for Dec_CC, even after it is approved on the initial If. I also tried to change the Then section to = "" and I get a runtime 13 error. Any thoughts?
If IsEmpty(ActiveSheet.Cells(21 + i, 16).Value) Then
Dec_CC = ActiveSheet.Cells(21+ i, 1g).Value 'also tried = "" here
Else: Dec_CC = Round(ActiveSheet.Cells(21 + i, 16).Value, 0)
End If