View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
shishi shishi is offline
external usenet poster
 
Posts: 33
Default How run Evaluate on a specified Sheet

Hi all,
I am trying to run Evaluate on a sheet that is not currently active. I
have a formula stored as a String. The Evaluate function works great on
the currently active sheet. But when I try to attempt the same Evaluate
function on another sheet, it fails..

Dim fStr As String
Dim listing As Variant
Dim rng As Range
Dim codeSheet As String

listing = Evaluate(ThisWorkbook.Sheets(codeSheet)!fStr)
Here fStr is the expression to evaluate. This is not working. If I
remove the ThisWorkbook.Sheets(codeSheet)!, it will just work fine, but
always works only on the active sheet. Please advise me how I can
correct this.

Thanks in advance,

shishi