Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am new to programming in VBA, and I am having trouble getting my program to
do what I want it too. Basically, We enter names and hours worked into one sheet, then I want to find that persons hourly rate from another worksheet and multiply it by their hours. These totals need to be added together to only include employees of the company and not contractors, material, or travel (that is what the "M" stands for). I am getting runtime errors when I run the program. Any help, suggestions or otherwise is greatly appreciated!! Function Labor() Dim row As Long ActiveCell.Formula = 0 For row = 3 To 34 If Worksheets("INPUT").Cells(row, "C").Value = "M" Then ML = Application.WorksheetFunction.Index(Worksheets("NA MES").Range("A10:K100"), Application.WorksheetFunction.Match(Worksheets("IN PUT").Cells(row, D).Value, Worksheets("NAMES").Range("A10:A100"), 1), WorksheetFunction.Match(H1, Worksheets("NAMES").Range("A10:K10"), 1)) * Cells(row, "H") ActiveCell.Formula = ActiveCell.Formula + ML End If Next row End Function Thank you!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Programming | New Users to Excel | |||
CD Programming | Excel Discussion (Misc queries) | |||
VBA programming | Excel Programming | |||
programming | Excel Programming | |||
Please help with programming | Excel Programming |