#1   Report Post  
Jim May
 
Posts: n/a
Default 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   Report Post  
Jim May
 
Posts: n/a
Default

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!!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Findlink Error D Moniz via OfficeKB.com Links and Linking in Excel 0 January 20th 05 04:53 PM
Error when entering and exiting excel Randy Excel Discussion (Misc queries) 1 January 11th 05 03:17 PM
Downloading Templates for Excel error with a windows error. Lanie Moore Excel Discussion (Misc queries) 0 December 20th 04 11:39 PM
#num! error message Frank Kabel Excel Worksheet Functions 0 November 18th 04 07:07 PM
#REF error Christen Excel Worksheet Functions 5 November 3rd 04 07:29 PM


All times are GMT +1. The time now is 07:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"