View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default Sumproduct with double quoted strings

Hello,
I have procedure that reads strings from a file
LayerC = Chr(34) & Layer & Chr(34)

Then Evaluate a count
CountIn = _
xlApp.Evaluate("SUMPRODUCT((" & _
MainDataRange.Address & "=" & TvahC & ")*(" &
RangeLayers.Address & "=" & LayerC & "))")

The problem is if the variable Layer contains double quotes (For
Example N"Y) , the new variable LayerC is now "N"Y", which the 2nd
statement does not accept

Any idea?
Thanks
Avi