View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Vba Formula To Include Activesheet Name

Since Cells(5,4) isn't qualified, I'm betting that it's on the activesheet, too:

Cells(5, 4).Formula = "=SUMPRODUCT(($R$" & lr & ":$R$" & br & "=$B$14)" _
& "*($I$" & lr & ":$I$" & br & "0))"




LuisE wrote:

Thanks in advanceHow can I get the following formula to work by making it
reference the name of the active sheet? Where lr and br are variables.

Cells(5, 4).Formula = "=SUMPRODUCT((ActiveSheet!$R$" & lr & ":$R$" & br &
"=$B$14)*(ActiveSheet!$I$" & lr & ":$I$" & br & "0))"

Thanks in advance


--

Dave Peterson