how to enter 'CTRL-SHIFT-ENTER' in vb

  • Thread starter Thread starter Mike Molyneaux
  • Start date Start date
M

Mike Molyneaux

I need to enter the 'ctrl-shift-enter' key sequence in a
cell that I am writing to.

Current code:

sheets("name").range("aa1").value = _
"{=sum(if(a1=nr,if(dept=70,if(acct=9," _
& "data!$k$2:$k$2000))))}"

upon execution of macro, cell aa1 contains data within
quotes, not the sum i'm looking for.

if i edit the cell & remove the { & }, then manually enter
the 'CTRL-SHIFT-ENTER' keystroke the cell updates
correctly?

Help

Thanks mike
 
Check out the range FormulaArray method.

--
Jim Rech
Excel MVP
|I need to enter the 'ctrl-shift-enter' key sequence in a
| cell that I am writing to.
|
| Current code:
|
| sheets("name").range("aa1").value = _
| "{=sum(if(a1=nr,if(dept=70,if(acct=9," _
| & "data!$k$2:$k$2000))))}"
|
| upon execution of macro, cell aa1 contains data within
| quotes, not the sum i'm looking for.
|
| if i edit the cell & remove the { & }, then manually enter
| the 'CTRL-SHIFT-ENTER' keystroke the cell updates
| correctly?
|
| Help
|
| Thanks mike
 
Mike, is it feasible to select on the range you are interested in first,
then use
Selection.FormulaArray
? Something like this
Selection.FormulaArray = "=IF(SUM(C[1])= 300, ""Yes"", ""No"")"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top