• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

FTE Calculation

Pinang

Member
Hi,
Can anybody help me out with user defined formula for FTE calculation?
I am looking for user defined VBA formula for yellow highlighted formula in attached file, refer attachment for more details.
Thanks in advance.
Pinang
 

Attachments

  • FTE Calculation.xlsx
    12.5 KB · Views: 4
Assuming that "Percentage allocation" is always column D & "No of Days" is always in Row 3. Select the first yellow cell in desired column & it will fill the rest.

Code:
Sub Macro1()

Dim ColumnA As String
Dim ColumnB As String
Dim ColumnC As String
Dim ColumnD As String

ColumnA = Mid(ActiveCell.Offset(0, -1).Address, 2, 1)
ColumnB = Mid(ActiveCell.Offset(0, -2).Address, 2, 1)
ColumnC = Mid(ActiveCell.Address, 2, 1)
ColumnD = "D"

ActiveCell.Formula = "=IFERROR((" & ColumnA & ActiveCell.Row & _
"-" & ColumnB & ActiveCell.Row & _
"+1)/" & ColumnC & "$3*$" & ColumnD & ActiveCell.Row & "%,0)"

Range(ColumnC & "5:" & ColumnC & Cells(Rows.Count, ColumnB).End(xlUp).Row).Select
Selection.FillDown

End Sub
 
I mean to say User Defined Function. VBA code like below.

Function FTE(Resource_SD as Date, Resource_ED as Date....)
Satatement....
End Function
 
Back
Top