Hi,
I'm trying to create a cell in Excell which contains more cells, i.e.: a cell that is the union of A1+B1+A2+B2.
Is there anyone who can help me, please?
Maybe I didn't explain the problem: I don't need to do the sum of the value, but a cell that is large like a1+b1+a2+b2 with excel union. After, I should put different values in A3, B3, etc.
You open excel, select the cells you want to merge and press on the merge cell button. (Don't have english excel, so it might be union instead of merge)
That is the response to your question if you don't give more information as in "from NAV" or Automation or something similar.
Please ask questions so that people understand exactly what you mean.
(while writing this down you've explained it a bit further)
Anyway, the function of the excel automation you seek is range. and the child-function merge.
The range function has 2 parameters: Cell 1 and 2. Ranges are always a square. So Cell 1 would be A1 and cell 2 would be B2. Effectively having a range A1 A2 B1 B2.
Next call the function range.merge and you have your cells merged.
I've got no code examples for this. But the excel buffer might use range.
|Pressing F1 is so much faster than opening your browser| |To-Increase|
You open excel, select the cells you want to merge and press on the merge cell button. (Don't have english excel, so it might be union instead of merge)
This is the operation I should make, but in NAV.
I wrote
XlWS.Range('A1','b2' ).Value := ("G/L Account"."No.");
but in this way I see the value in 4 cells (A1,B1,A2,B2) and not a big cell with this value, as I should have.
Any idea?
To answer questions like this for yourself, record a macro in excel doing whatever you need. Then look at the genereted VBA-Code and reimplement it in C/AL.
Comments
later push the individual values to the cells.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thanx
ls
That is the response to your question if you don't give more information as in "from NAV" or Automation or something similar.
Please ask questions so that people understand exactly what you mean.
(while writing this down you've explained it a bit further)
Anyway, the function of the excel automation you seek is range. and the child-function merge.
The range function has 2 parameters: Cell 1 and 2. Ranges are always a square. So Cell 1 would be A1 and cell 2 would be B2. Effectively having a range A1 A2 B1 B2.
Next call the function range.merge and you have your cells merged.
I've got no code examples for this. But the excel buffer might use range.
|To-Increase|
I wrote
XlWS.Range('A1','b2' ).Value := ("G/L Account"."No.");
but in this way I see the value in 4 cells (A1,B1,A2,B2) and not a big cell with this value, as I should have.
Any idea?
Thanx
ls
xlws.range('A1','B2').merge;
XlWS.Range('A1','B2').Value := ("G/L Account"."No.");
or
xlws.range('A1').value := "G/L Account"."No.");
xlws.range('A1','B2').merge;
|To-Increase|
xlWorkSheet.Range('A1','B1').mergecells;
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
It works! =D> =D> =D>
Thanx
ls