Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default evalute error

Tom Ogilvy kindly helps me with the code to evalute for a report. I now have
a new related problem.

In the following code, the first case statement works, but when I select the
second, if fails with runtime error 424. In debug, it highlights the line
"Set rng = Evaluate(s)" for the second case. The definition popup states
"Cannot jump to "Evaluate" because it is hidden. It actually captures the
first c and places in the Report sheet.

Do I need to reset something? Am complete novice in excel VBA.

Select Case ComboBox1.Value
Case "GSOP_0286"
Set refrange = Sheets("Sheet2").Range("A3:A20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else

s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c

Case "GSOP_0287"
Set refrange = Sheets("Sheet2").Range("B3:B20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else
s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c


Thanks,
--
Brian McCaffery
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default evalute error

Please ignore - The error was due to me.

I will write out a hundred time, "Always check you data"

Thanks,
--
Brian McCaffery


"Brian" wrote:

Tom Ogilvy kindly helps me with the code to evalute for a report. I now have
a new related problem.

In the following code, the first case statement works, but when I select the
second, if fails with runtime error 424. In debug, it highlights the line
"Set rng = Evaluate(s)" for the second case. The definition popup states
"Cannot jump to "Evaluate" because it is hidden. It actually captures the
first c and places in the Report sheet.

Do I need to reset something? Am complete novice in excel VBA.

Select Case ComboBox1.Value
Case "GSOP_0286"
Set refrange = Sheets("Sheet2").Range("A3:A20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else

s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c

Case "GSOP_0287"
Set refrange = Sheets("Sheet2").Range("B3:B20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else
s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c


Thanks,
--
Brian McCaffery

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
I need to evalute two cells and return a result dp Excel Worksheet Functions 1 March 11th 09 09:20 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Evaluate a cell evalute 3 cell based on result stevem8435 Excel Programming 1 January 27th 06 09:23 AM
How do create a formula to evalute a # to return 1 of 4 conditions Larry Excel Worksheet Functions 4 May 29th 05 12:58 AM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 11:43 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"