Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Why R/T Error?
Sub SumByEmployee()
Dim MyPick As String Dim mTotal As Double Dim rngemp As Range mTotal = 0 MyPick = InputBox("What Employee Do you Want?") Set rngemp = Range("C6:C15") 'list of employees - single names For Each c In rngemp If c = MyPick Then mTotal = mTotal + rngemp.Offset(, -1).Value 'R/T error happens here End If Next c Range("B18").Value = mTotal End Sub Thanks for any help!! |
#2
|
|||
|
|||
I think I got it; changed line to:
mTotal = mTotal + c.Offset(, -1).Value "Jim May" wrote in message news:Pe0zd.9984$jn.301@lakeread06... Sub SumByEmployee() Dim MyPick As String Dim mTotal As Double Dim rngemp As Range mTotal = 0 MyPick = InputBox("What Employee Do you Want?") Set rngemp = Range("C6:C15") 'list of employees - single names For Each c In rngemp If c = MyPick Then mTotal = mTotal + rngemp.Offset(, -1).Value 'R/T error happens here End If Next c Range("B18").Value = mTotal End Sub Thanks for any help!! |
#3
|
|||
|
|||
Pls see my post in programming. Please do NOT multipost. We read em all.
-- Don Guillett SalesAid Software "Jim May" wrote in message news:Pe0zd.9984$jn.301@lakeread06... Sub SumByEmployee() Dim MyPick As String Dim mTotal As Double Dim rngemp As Range mTotal = 0 MyPick = InputBox("What Employee Do you Want?") Set rngemp = Range("C6:C15") 'list of employees - single names For Each c In rngemp If c = MyPick Then mTotal = mTotal + rngemp.Offset(, -1).Value 'R/T error happens here End If Next c Range("B18").Value = mTotal End Sub Thanks for any help!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Findlink Error | Links and Linking in Excel | |||
Error when entering and exiting excel | Excel Discussion (Misc queries) | |||
Downloading Templates for Excel error with a windows error. | Excel Discussion (Misc queries) | |||
#num! error message | Excel Worksheet Functions | |||
#REF error | Excel Worksheet Functions |