Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Another runtime 1004 error

Hello all,

I am using an Excel 2003 sheet from a company. When ever I choose a
cell to answer a yes/no question, I get the following error.

"Runtime error 1004"

application-defined or object defined error"

When I hit debug, it shows me the place in the code causing the problem

(this is just part of the code)
' initialise tallies
noRed = 0
noYellow = 0
noGreen = 0
noNeutral = 0

For Each thisRow In Range(sheet & "_Descriptions").Cells
' for each question

' If level 3 set the score cell
If (thisRow.Cells(1, colDescription).Interior.Color = ilevel3) Then
' remember the cell
Set L3Cell = thisRow.Cells(1, colScore)
' Restore original colour in case it had been highlighted
L3Cell.Interior.Color = ilevel3

End If

With thisRow.Cells(1, colScore).Interior
' tally up cells in each of the three colours

If (.Color = iRed) Then
noRed = noRed + 1
' and set the Level3 score cell to highlight
L3Cell.Interior.Color = ihighlight

ElseIf (.Color = iYellow) Then
noYellow = noYellow + 1
ElseIf (.Color = iGreen) Then
noGreen = noGreen + 1
ElseIf (.Color = iNeutral) Then
noNeutral = noNeutral + 1
End If
End With

Next

' Put tallies in the sheet's tally cells
Range(sheet & "_Reject").Value = noRed
Range(sheet & "_Caution").Value = noYellow
Range(sheet & "_Accept").Value = noGreen
Range(sheet & "_Unanswered").Value = noNeutral <---- **it shows
error here**

End Sub

I do not know how to write macros, so I have no idea what is wrong. I
am just the end user. It does this everytime I try to answer a question
in the spreadsheet. The sheet tabulates a score as I answer each
question.
If I delete the offending line of code, the error goes away, but then I
have no idea how I have effected the macro.

any help would be greatly appreciated.

thanks
Paulbill

  #2   Report Post  
 
Posts: n/a
Default

BTW the spreadsheet/macro was written using Excel 2002

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

It suggests that you don't have a range named sheet & "_Unanswered".

As you profess no ability with VBA you might struggle to resolve it. If you
like you could send it to me and I could look at it for you.

--
HTH

Bob Phillips

wrote in message
ups.com...
BTW the spreadsheet/macro was written using Excel 2002



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
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
excel chart export error runtime 1004 Mau Charts and Charting in Excel 3 August 17th 05 11:35 AM
Runtime Error '1004' [email protected] Excel Discussion (Misc queries) 2 July 18th 05 06:10 AM
Help: runtime error - Method seriescollection object_chart failed huangx06 Charts and Charting in Excel 3 July 9th 05 12:27 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 04:14 PM.

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"