Convert Excel Formula to VBA code -


could please advise how convert formula vba code

=sumproduct(subtotal(3,offset((at2:at644),row(at2:at644)-min(row(at2:at644)), ,1)) * (at2:at644="6")) 

i this, question how use "offset" in current code?

application.worksheetfunction.sumproduct(application.worksheetfunction.subtotal(3, application.range.offset(("at2:at644"), application.rows("at2:at644") - application.worksheetfunction.min(application.rows("at2:at644")), , 1)) * ("at2:at644" = "6")) 

thanks,
regards,
lure

migrated comment...

debug.print sheet1.evaluate("sumproduct(subtotal(3,offset((at2:at644),row(at2:at644)-min(row‌​(at2:at644)), ,1)) * (at2:at644=""6""))")  

or whichever sheet need use, don't use application.evaluate unless want evaluate in context of activesheet.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -