ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to enter 'CTRL-SHIFT-ENTER' in vb (https://www.excelbanter.com/excel-programming/297351-how-enter-ctrl-shift-enter-vbulletin.html)

mike molyneaux

how to enter 'CTRL-SHIFT-ENTER' in vb
 
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

Frank Kabel

how to enter 'CTRL-SHIFT-ENTER' in vb
 
Hi have a look at the
formulaarray
property

--
Regards
Frank Kabel
Frankfurt, Germany


Mike Molyneaux wrote:
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


Jim Rech

how to enter 'CTRL-SHIFT-ENTER' in vb
 
Check out the range FormulaArray method.

--
Jim Rech
Excel MVP
"Mike Molyneaux" wrote in message
...
|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



William Ryan eMVP

how to enter 'CTRL-SHIFT-ENTER' in vb
 
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"")"
"Mike Molyneaux" wrote in message
...
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 molyneaux

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

Thank all of you very much, working great.


All times are GMT +1. The time now is 04:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com