Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Tye Thompson   on Mar 02 In MS Office Category.

  
Question Answered By: Deloris Harris   on Mar 02

I ended up re-runing the same code  after more data was added was added to the
other cells and it seems to work now. I guess excel wants the data in place
before the formula.

The logic I changed was:
Worksheets(shCurrent).Cells(i + 13, 5) = _
"=IF(ISERROR(SUMIF('Detail INC " & SchM & "'!G:G,C"
& i + 13
& ",'Detail INC " & SchM &
"'!J:J))=TRUE,0,SUMIF('Detail INC " &
SchM & "'!G:G,C" & i + 13 & ",'Detail INC " & SchM &
"'!J:J))"

changed to:
Worksheets(shCurrent).Cells(i + 13, 5).Formula = _
"=IF(ISERROR(SUMIF('Detail INC " & SchM & "'!G:G,C"
& i + 13
& ",'Detail INC " & SchM &
"'!J:J))=TRUE,0,SUMIF('Detail INC " &
SchM & "'!G:G,C" & i + 13 & ",'Detail INC " & SchM &
"'!J:J))"

Since the default to Cells(R,C) is value, I was confusing Excel by loading a
formula as a value (so I read on the web). Didn't help the process, I still have
to re-run the code, but it looks better.

I was thinking, Excel didn't load the values due to link to other sheets but
refreashing the links didn't help either. I wish I understood why this works,
but it does, and the client is happy.

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Code not updating cell value Or get search suggestion and latest updates.


Tagged: