Hi Everyone,
I have a formula that does exactly what i want, but my friend cant use it on his computer (he doesn't have Excel 2007)
I'm trying to create a Custom Function/ UDF to do this in excel VBA but ive hit a bit of a road bump.
my VBA code at the moment
My formula checks the first cell in a range (always a Row) and every third one thereafter. and simply returns the associated number.
Any help and comments would be great,
thanks in advance
-Bromy
I have a formula that does exactly what i want, but my friend cant use it on his computer (he doesn't have Excel 2007)
I'm trying to create a Custom Function/ UDF to do this in excel VBA but ive hit a bit of a road bump.
Code:
=IF((OR(E13=0,ISBLANK(E13))),IF((OR(H13=0,ISBLANK(H13))),IF((OR(K13=0,ISBLANK(K13))),IF((OR(N13=0,ISBLANK(N13))),IF((OR(Q13=0,ISBLANK(Q13))),IF((OR(T13=0,ISBLANK(T13))),IF((OR(W13=0,ISBLANK(W13))),IF((OR(Z13=0,ISBLANK(Z13))),IF((OR(AC13=0,ISBLANK(AC13))),IF((OR(AF13=0,ISBLANK(AF13))),IF((OR(AI13=0,ISBLANK(AI13))),IF((OR(AL13=0,ISBLANK(AL13))),"99","12"),"11"),"10"),"09"),"08"),"07"),"06"),"05"),"04"),"03"),"02"),"01")
my VBA code at the moment
Code:
Function LatestSales(Sales_Range)
Dim Sales_Range As Range
Dim Range_Value As Integer
Dim n2 As Integer
Dim July As Integer
Dim August As Integer
Dim September As Integer
Dim October As Integer
Dim November As Integer
Dim December As Integer
Dim January As Integer
Dim Febuary As Integer
Dim March As Integer
Dim April As Integer
Dim May As Integer
Dim June As Integer
Range_Value = 0
n2 = 3
For Sales_Range = 1 To Count.Cells.Sales_Range Step 1
Range_Value = Range_Value + 1
If Int((Range_Value + 2) / n2) = (Range_Value + 2) / n2 Then
MsgBox ("Whole number")
Else
MsgBox ("Not a whole number")
End If
End Function
My formula checks the first cell in a range (always a Row) and every third one thereafter. and simply returns the associated number.
Any help and comments would be great,
thanks in advance
-Bromy