SeanJ
11-11-2008, 08:43 AM
I need help on this formula please see below.
This is a formula for a cell =IF((AND(ISBLANK(A29),ISBLANK(A30),ISBLANK(A31))),"",1) I want us it in VBA. I have other formula like this one bjut more in depth. They all work from the cells but I am having issues converting to VBA. I keep getting error 1004, and I don't know why
Function Setting_voucher_count_formulas(FndString As String)
If FndString = "happy" Then
x = 28
ElseIf FndString = "sad" Then
x = 38
ElseIf FndString = "not yet" Then
x = 48
End If
numRowcount = x
'=IF((AND(ISBLANK(A29),ISBLANK(A30),ISBLANK(A31))),"",1)
ws.Cells(numRowcount, 4).FormulaR1C1 = "=IF((AND(ISBLANK(R[-1]C),ISBLANK(R[-2]C),ISBLANK(R[-3]C))),"",1)"
End Function
This is a formula for a cell =IF((AND(ISBLANK(A29),ISBLANK(A30),ISBLANK(A31))),"",1) I want us it in VBA. I have other formula like this one bjut more in depth. They all work from the cells but I am having issues converting to VBA. I keep getting error 1004, and I don't know why
Function Setting_voucher_count_formulas(FndString As String)
If FndString = "happy" Then
x = 28
ElseIf FndString = "sad" Then
x = 38
ElseIf FndString = "not yet" Then
x = 48
End If
numRowcount = x
'=IF((AND(ISBLANK(A29),ISBLANK(A30),ISBLANK(A31))),"",1)
ws.Cells(numRowcount, 4).FormulaR1C1 = "=IF((AND(ISBLANK(R[-1]C),ISBLANK(R[-2]C),ISBLANK(R[-3]C))),"",1)"
End Function