LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SUMPRODUCT Not Working

I am populating an Excel Spreadsheet in VBA from an Access Front end

Dim sTmp As String
Dim ctr As Integer

sTmp = "=SUMPRODUCT((D<<StartRow:D<<Row<" & Chr(34) & Chr(34) &
")/COUNTIF(D<<StartRow:D<<Row,D<<StartRow:D<<Ro w&" & Chr(34) &
Chr(34) & "))"

sTmp = Replace(sTmp, "<<StartRow", StartRow)
sTmp = Replace(sTmp, "<<Row", Row - 1)

With mActiveWorkSheet
.Cells(Row, 4) = sTmp
.Cells(Row, 7) = "=SUM(G" & StartRow & ":G" & Row - 1 & ")"
'Borders
For ctr = 1 To 7
DoEvents
With .Cells(Row, ctr)
.Borders(xlEdgeBottom).LineStyle = xlDouble
.Borders(xlEdgeBottom).Weight = xlThick
.Borders(xlEdgeBottom).ColorIndex = xlAutomatic
.Font.Bold = True
End With
Next

End With

My problem is that Row, 4 takes the formula as a literal and displays
the formula not the result and Row, 7 works fine. I know the formula
work because if I type it in manually it works and I have compared the
outputs visually.

Also just an opinion question but is this the best practice I have no
idea which row the formula will reside on so If there is a way to use a
template and have the formula slide down with every entry and it would
have to recreate its self for each break I would like to know about.

 
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
sumproduct not working bigproblem Excel Discussion (Misc queries) 2 March 8th 10 11:57 PM
Sumproduct not working Curtis Excel Worksheet Functions 3 November 6th 09 04:20 AM
SUMPRODUCT not working. Nde Excel Worksheet Functions 2 October 16th 07 09:19 PM
SUMPRODUCT Not Working dj479794 Excel Discussion (Misc queries) 2 March 12th 07 12:54 PM
Sumproduct not working macamarr Excel Worksheet Functions 5 December 28th 06 02:36 PM


All times are GMT +1. The time now is 02:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"